McALLEN — Citing a need to promote respect for the law, and building community trust, among other reasons, a federal judge handed down stiff sentences to former police officers convicted of lying to federal agents.

U.S. District Judge Micaela Alvarez admonished former San Juan police officers Salvador Hernandez and Richard Leon Castillo with harsher sentences than expected during their hearing Tuesday morning, saying they, above all others, should know the “importance of being honest.”

Alvarez sentenced Hernandez and Castillo to 24 months and 16 months in prison, respectively, for their roles in a case connected to the alleged theft of 3 kilos of cocaine, saying their actions have tainted public trust in law enforcement.

They will each have to serve three years of supervised release upon completion of their prison terms.

Hernandez and Castillo were facing a maximum of up to six months in prison after their May convictions on making false statements to Drug Enforcement Administration agents, but government prosecutors asked the court to vary from the sentencing guidelines, and give more than the recommended maximum.

It was just a few months ago, in mid-May, when jurors came back after more than a week of testimony with not guilty verdicts in the trial of Hernandez and his former colleague Castillo, who were accused of working together to steal cocaine from a seizure nearly two years ago.

The jury decided that the government didn’t do enough to prove a cocaine conspiracy involving the two officers. Hernandez, however, was found guilty on both counts of lying to federal agents.

The trial was the second involving the two men, who were acquitted by jurors of drug conspiracy charges on Dec. 18, 2017, after a week’s worth of testimony. But Castillo had also been found guilty of lying to federal agents — the same fate Hernandez met in the May trial.

The trial was connected to what later was revealed to be a staged car crash in a San Juan orchard. The vehicle contained several kilos of sham cocaine, and was intended to be seized by law enforcement.

But after taking inventory of the narcotics, authorities realized bundles of cocaine were missing, and an investigation was initiated by DEA agents, which led to the two men making false statements.

On Tuesday, despite failing to pin down the now-former cops on cocaine conspiracy charges, the government argued the court for a higher sentence for them from what’s recommended in the sentencing guideline.

Their argument, based on the evidence presented during the two trials that showed — at least in part — that the men intentionally lied to DEA agents during the investigation into missing cocaine bundles in order to deceive or cover up other criminal conduct.

Before Alvarez handed down the sentences, Hernandez, seemingly maintaining his innocence, said he wished he had just “slowed down,” and clarified statements he made to DEA agents that subsequently were his downfall.

Castillo argued he should be spared prison custody, and should be placed on probation because he had complied with all supervised release requirements during his time awaiting trial.

But Assistant U.S. Attorney Kristen Rees, who characterized Hernandez’s statements as offensive, argued the men deserved just punishment, to show that lying to federal agents should have harsh consequences.

“Yes, they lose their badges, and they lose their guns,” Rees said. “But zero to 6 months is nothing.”

The court, addressing Hernandez’s statement about “slowing down,” and clarifying statements to federal agents if he had known he was under investigation, said it wouldn’t matter if he was under investigation or not, he would still need to give honest answers.

After the hearing, Douglas Allen A’Hern, who represented Hernandez through both trials, said he was surprised by how much the court varied from the maximum six months.

“The guidelines exist for a reason and we’re disappointed with moving from the max six months to 24 months. We don’t think it’s in any way justified given these circumstances,” A’Hern said.

The Houston-based attorney said they would be appealing the sentence handed down to his client.

“Ultimately you have to respect the judicial system and the court, but we’re appealing the sentencing,” the attorney said.

McAllen attorney Reynaldo M. Merino, who defended Castillo through both trials, declined comment Tuesday afternoon.

Both Hernandez and Castillo will be allowed to remain free on bond pending their surrender dates, which will be determined at a later time.