BALTIMORE (AP) — A Baltimore police officer who was a distant contender for the Republican nomination for mayor in 2020 has pleaded guilty to perjury, Maryland’s state prosecutor announced Friday.

Ivan Gonzalez falsely claimed on certified candidacy paperwork that he was a resident of the city of Baltimore, according to a statement of facts in support of the plea. However, the 13-year veteran of the city’s police force actually lived in a suburb. Anyone running for Baltimore mayor has to be a city resident for at least a year before an election.

READ MORE: Flash Floods In Maryland Close Some Schools, Roads; Several Rescued In High Water, MSP Responds To More Than 500 Calls

In a statement, Maryland State Prosecutor Charlton T. Howard III said Gonzalez was sentenced Friday by a circuit court judge to three years of probation for intentionally committing perjury by providing false information to establish his qualifications as a candidate. He gave a Baltimore post office box as his mailing address but his principal residence is actually in Essex, a community outside of the city.

As part of his plea agreement, Gonzalez agreed to resign from his job as a sworn city officer.

“His law enforcement career has ended and he has now been held accountable under the law,” Howard said.

READ MORE: CDC Advisory Panel Backs FDA Decision For COVID-19 Booster Shots, Baltimoreans React

Gonzalez had an unusual platform as a mayoral candidate, claiming he would “wage war” not only on criminals but also on “toilet water” judges and the state’s attorney — whom he referred to as an “idiotbox” in an online campaign announcement.

If he were elected, Gonzalez asserted he would work as mayor during the day and then patrol the streets as a uniformed police officer at night carrying his “police-issued rifle.” He vowed he would hire 900 more police officers by putting prisoners to work cutting grass in the city instead of hiring people, among other things.

He got less than 700 votes during the 2020 primary, finishing fifth out of seven candidates.

Gonzalez did not immediately respond to a message seeking comment. Last year, a Baltimore Sun reporter called Gonzalez regarding the discrepancy about his address and he hung up on them after dismissing the paper as “fake news.”

MORE NEWS: 'It's Really Unfortunate': Students In Anne Arundel County React To News Of Postponed Homecoming Dances

(© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)