WHITE PLAINS — Condemning him for having “corrupted the Democratic process,” a federal judge on Wednesday sentenced Malcolm A. Smith, former majority leader of the New York State Senate, to seven years in prison for consenting to the payment of tens of thousands of dollars to Republican Party leaders to permit him, as a registered Queens Democrat, to run for mayor in 2013 on their party’s line.

With more than 40 relatives and friends crowding the courtroom and its aisles, Mr. Smith, 58, betrayed little emotion throughout an hourlong proceeding in United States District Court here and spoke only briefly to remind Judge Kenneth M. Karas of a letter he had written him two weeks earlier. In it, he appealed for mercy, describing himself as a “humbled and broken man” without quite admitting to a crime or expressing remorse.

“My career has been destroyed, my family is in pain and I am likely to lose my freedom for some period of time,” he wrote. “But my life is not over, and my work is not done. Judge, I beg you to spare me a lengthy prison sentence so I can get my life back together, for my family, for myself and for the people I have yet to meet but whose lives I hope to positively impact in the future.”

He denied that he was greedy with power, as prosecutors working for Preet Bharara, the United States attorney for the Southern District of New York, had portrayed him. The reason he wanted to be mayor, he wrote, was “the opportunity to help others,” something he insisted had motivated him since childhood because his mother made a promise to God that if she had a son “he would always maintain his Christian faith and do all he could to help others improve their lives.”