FRESNO — Former Bakersfield Police Department Detective Patrick Mara was sentenced Monday to five years in federal prison following tearful pleas for leniency from friends and relatives.

Mara, 36, admitted in his plea agreement that he conspired with his partner in the BPD, former Detective Damacio Diaz, to use their positions as police officers to steal narcotics from drug dealers and sell them through a third party for their own personal gain. The U.S. Attorney’s Office had recommended a sentence of 21 to 27 years.

Following sentencing, Mara said he wanted to debunk allegations that other police officers were involved in the conspiracy to sell drugs. He said only he and Diaz broke the law, and no one else at the BPD was aware of what they were doing.

Mara said he plans to help his family get “situated and stable” before he surrenders Dec. 5. He said he’s had a lot of sleepless nights leading up to Monday’s sentencing, and he’s relieved this part of his ordeal is over.

Mara’s attorney, Fred Gagliardini, said he thought the judge was fair in imposing sentence.

Several friends and relatives of Mara spoke in his support before Judge Lawrence J. O’Neill pronounced sentence at the federal courthouse.

Calling Patrick Mara her hero, Kristin Mara, his wife, said there was a sudden change in her husband’s demeanor after he was promoted to the BPD’s narcotics squad.

“It was then that I began to see the obsession in him,” she said.

Mara became detached at home, she said, and often had a “glazed” look in his eyes, as his job became the only thing he cared about. Their marriage suffered, as did Mara’s relationship with his young children.

“Work was his life,” she said. “His work was his wife. His work was his children. His work was everything.”

It wasn’t until 2013, when he was transferred out of narcotics, that Patrick Mara started to revert back to the man she married, Kristin Mara said. Their relationship improved and their children got their father back.

Kristin Mara tearfully told the court she is “desperately grasping” to hang onto the remnants of their life together. She asked the judge to take into consideration her children and how this case has impacted her family.

They were forced to sell their house and most of their belongings, she said. Now they live in a trailer on property belonging to a friend.

Alexis Etcheverry, whose ex-husband worked with Mara at the BPD, told the court Mara was the only person to stand behind her then-husband after he suffered a career-ending injury and spiraled into alcoholism. Mara, she said, encouraged him to get sober and didn’t give up on him despite his many setbacks.

Mara’s father, Michael Mara, said his son’s downfall has been especially difficult as both he and Mara’s mother are former law enforcement officers. He said his son betrayed his former officers and the community he served.

Still, Michael Mara said, he can tell his son is truly remorseful, and his criminal actions don’t reflect the smart, compassionate person he is.

Lastly, Patrick Mara addressed the court, beginning by apologizing to the Bakersfield Police Department and the community at large. He said weakness is the “short and simple answer” as to why he betrayed the public’s trust.

In 2012, he had filed for bankruptcy, his marriage was falling apart and he was drinking heavily, he said. He accepted “easy money” from Diaz, he said, and things quickly escalated.

“I had become a full-blown dirty cop,” he said.

Mara sniffled repeatedly as he begged O’Neill for mercy, and said he was filled with hope for a chance at redemption.

Before sentencing their father, O’Neill directly addressed Mara’s children. He told them they will get their father back, and implied they shouldn’t judge him too harshly.

“You need to understand, both of you, that just because someone does something bad it does not mean they are a bad person,” O’Neill said.

Continuing in that vein, O’Neill, now speaking to everyone, said in his 27 years as a judge only two people have come before him who he believed were completely evil.

“This isn’t one of those cases,” he said.

The judge said he finds it unlikely that Mara will ever commit another crime, and that his behavior in this case is out of character. Mara nodded his head as O’Neill spoke.

But the judge noted there are many victims of Mara’s crimes, and punishment was necessary.

According to prosecutors, Mara and Diaz admitted to stealing 20 pounds of methamphetamine that should have been booked into evidence. They enlisted the help of BPD patrol officers to pull over vehicles they believed carried methamphetamine due to information received from confidential sources.

After the vehicles were stopped and the meth found, Mara and Diaz would instruct the officers to book only a fraction of the drug, and the detectives then took possession of the remaining amount.

Only Diaz and Mara have been charged in the case. Court filings do not state the degree to which other officers were complicit or unaware of the detectives’ activities.

Diaz was sentenced earlier this month to five years in prison. The U.S. Attorney’s Office had recommended a sentence of between roughly 17 and 22 years.

Mara, a 13-year veteran of the BPD, pleaded guilty in June to one count of conspiracy to distribute and possess with the intent to distribute methamphetamine.

He joined the BPD in January 2003 and worked patrol for the first 2 1/2 years, then joined the force’s gang unit in 2005. In 2008, he went back to patrol until 2011, when he was assigned to the BPD’s narcotics task force.

He was promoted to detective in 2013.