CNN  — 

The former head of counterintelligence for the FBI’s New York field office was sentenced to just over four years in prison for working for a sanctioned Russian oligarch after leaving the government.

Charles McGonigal, a 22-year veteran of the FBI, pleaded guilty in August to one count of conspiracy to violate US sanctions and money laundering for working for Oleg Deripaska, a wealthy Russian with close ties to Russian President Vladimir Putin.

Judge Jennifer Rearden sentenced McGonigal to 50 months in prison, just below the statutory maximum of five years. The judge ordered McGonigal to surrender to prison on February 26.

McGonigal, the judge said, “repeatedly flouted and manipulated the sanctions regimes vital” to US national security interests and “the undeniable seriousness of this and the need to respect the law … compels a meaningful custodial sentence.” At the same time, the judge said his actions “do not all together stamp out” his distinguished career and the “profoundly important contributions” he made to the US.

Before the sentencing was handed down, McGonigal told the judge he has a “deep sense of remorse and sorrow for my actions.”

“I, more than anyone, know that I have committed a felony and as a former FBI special agent it causes me extreme mental, emotional and physical pain – not to mention the shame I feel in embarrassing myself and the FBI, the organization I love and respect,” he said while fighting back tears.

“I’m humbly asking for a second chance,” McGonigal told the judge.

Prosecutors argued McGonigal should receive five years in prison, saying his work for Deripaska put US national security at risk, positing that if a foreign government had to choose between military supplies or having the former FBI counterintelligence chief “on their payroll,” it is an easy decision.

“How much would that be worth to them? Our enemies have guns and they know where to buy more. What they do not have is the rule of law. We do. That is what McGonigal tried to sell,” argued Hagan Scotten, a prosecutor. “Poverty did not motivate this crime, your honor. Greed did. It was a betrayal.”

Seth DuCharme, McGonigal’s attorney, asked for a no-prison sentence, citing McGonigal’s decades of public service. He said Deripaska asked McGonigal to dig up dirt on a rival oligarch, which did not seem “particularly nefarious,” but it did break the law.

DuCharme added that McGonigal was lured by the risk and reward, calling it a “terrible decision.”

DuCharme asked the judge to consider a recent seven-hour meeting McGonigal had with seven government agencies, which he said he was not allowed to discuss but was known to the judge under seal, as evidence of his willingness to cooperate.

In September, McGonigal pleaded guilty in a separate case in Washington, DC, to concealing hundreds of thousands of dollars he received from a former Albanian intelligence employee as well as foreign contacts he made with the individual. He is scheduled to be sentenced in that case in February.

DuCharme asked the judge to recommend McGonigal serve his sentence in the New York area.