Hiram Monserrate exits U.S. District Court in Manhattan on Tuesday.

Veteran politician Hiram Monserrate was sentenced on Tuesday to two years in prison for secretly diverting taxpayer funds designated for a community group to his campaign fund during a 2006 bid for the state Senate.

Before receiving the sentence in Manhattan federal court, the former Queens lawmaker choked back tears and evoked his elderly mother and disabled son while pleading with a judge for a sentence of community service.

"I apologize for the emotion," Mr. Monserrate said. "If I was alone on this earth, I probably wouldn't be this emotional."

A former New York Police Department officer who was a City Council member in 2006, Mr. Monserrate pleaded guilty in May to one count of mail fraud and one count of conspiracy to commit mail fraud. Each charge carried a maximum sentence of 20 years in prison.

He admitted to funneling $300,000 in council discretionary funds to the Latino Initiative for Better Resources and Empowerment, a nonprofit he controlled. About $100,000 of that taxpayer money was misused for his failed Democratic primary campaign for a state Senate seat.

Judge Colleen McMahon compared Mr. Monserrate to Richard Nixon, whom she said also let political ambition drive him to commit crimes. "You didn't use [the money] to buy a Cadillac," the judge said, "but you used it for yourself."

Mr. Monserrate, 45 years old, first won election to the council in 2001, representing the city's 21st District that includes the Queens neighborhoods of Corona, Elmhurst and Jackson Heights. He was elected to the state Senate in 2008 and eventually defected from the Democratic caucus, helping swing the balance of power in the chamber to the Republicans for a time.

He was expelled from the Senate following his conviction in an assault case involving his girlfriend. In that case, he was initially charged with a felony after his girlfriend, Karla Giraldo, told hospital staff and investigators that he had attacked her in a jealous rage.

She later changed her account to describe her cut as an accident, and Mr. Monserrate was convicted of misdemeanor assault. He was sentenced to three years of probation and ordered to perform community service and attend domestic-abuse counseling.

Mr. Monserrate's two-year prison sentence in the federal corruption case is set to begin on March 11. He also faces a three-year period of supervised release as well as a restitution payment of nearly $80,000.