Maryland requires “all party consent” before recording any conversations (remember Linda Tripp?). Police Sergeant Carlos Vila is now out of a job, not just for making the recording, but also because he played it for others to hear. Know your state’s laws before you consider recording any phone conversations.

BALTIMORE —A Baltimore City police officer has agreed to resign his post so charges against him in an illegal phone recording case will be dropped.

Sgt. Carlos Vila was indicted in August 2012 under the state’s wiretapping law after he was accused of illegally recording Baltimore Judge Joan Gordon, who sits in the city’s eastside district court. Officials said in April 2012, Vila used his cellphone to record an argument he had with Gordon about a warrant.

Aside from the wiretapping charge, Vila was also charged with playing the recordings for his colleagues. Both charges are felonies.

A month prior to this, Gordon filed a complaint against Vila, accusing him of making offensive comments to her.  The wiretapping charge was made by a Baltimore police internal affairs investigator.

It’s illegal in Maryland to make an audio recording of someone without their consent. The judge found out about the recording and filed a complaint, which sparked the investigation.

The case was declared a mistrial last March. On Friday, the city state’s attorney’s office said Vila had agreed to resign from the force in exchange for the charges being dropped. It means Vila can never seek future employment in law enforcement.

“This officer violated the law and has accepted responsibility for his conduct. This agreement is a just outcome for all involved, including our citizens,” State Attorney Gregg Bernstein said.

Gordon said in a statement that she thinks the resignation is a fair and appropriate resolution.

Vila was an 18-year veteran of the force when the charges were filed.