SAN ANTONIO — A man masquerading as a police officer who somehow managed to get a job running a county jail in Texas, has been sentenced to 63 months in prison for repeatedly taking guns aboard planes.

Federal prosecutors say the bizarre case of Jordan Jericho Bautista-Gunter began in late 2015, when he secured a contract to help turn around the Frio County Jail which had been shut down earlier that year for failing to meet state standards.

Local officials had given the 26-year-old Bautista-Gunter the $100,000 a year job because they believed he was a licensed police officer. They were wrong.

Turns out Bautista-Gunter had pretended to be a cop before in the state of Maryland, where he went by the name of Forrest Jordan Burghard Gunter, and had been arrested there several times. In 2011, he pleaded guilty to possessing a concealed deadly weapon and was given a three-year suspended sentence. As a result, he was banned from carrying a firearm or any police equipment.

Later that year, he was busted again when he was spotted wearing body armor and carrying a baton after getting a job as a bail bondsman, the Herald-Mail reported. At the time, Bautista-Gunter’s mother said her son suffered from Asperger’s Syndrome, a form of autism.

Prosecutors say in late 2014, he legally changed his name in Texas to Jordan Jericho Bautista-Gunter.

Frio County Attorney Joseph Sindon told the San Antonio Express-News that Bautista-Gunter spoke like a cop and was thoroughly convincing.

“He said the right things, checked the right boxes,” he said. “As much as everyone here feels pretty silly about this, we weren’t the only ones he duped.”

Shortly after getting the job running the jail, the story took an even stranger turn, prosecutors said. While conditions at the jail improved and state officials allowed it to be reopened, Bautista-Gunter was accused of sexually harassing an employee, the newspaper reported.

In January 2016, Bautista-Gunter showed up at the home of a former inmate in the middle of the night and demanded a urine sample. When Bautista-Gunter called local cops to help transport the former inmate back to jail, the responding officers ran a check and realized they were dealing with a man pretending to be a cop.

He was arrested by the feds in February on charges of taking guns on planes nearly two dozen times as part of prisoner transfers by telling airline and security officials he was a cop. He has been jailed since.

Prosecutors have alleged that Bautista-Gunter may have had some involvement in a murder-for-hire plot, although he was never charged.