Thomas Gore leaves the U.S. District Courthouse in May 2012. (Katherine Frey/THE WASHINGTON POST)

A top campaign aide to Mayor Vincent C. Gray was sentenced Friday to six months in prison for his role in secretly paying off a competing candidate to verbally attack Adrian M. Fenty.

Thomas W. Gore, who was the campaign’s assistant treasurer and handled its day-to-day finances, must serve 180 days of home detention after completing his sentence and perform 200 hours of community service. In May, he pleaded guilty to campaign-finance violations and a felony charge of obstruction of justice after he was secretly recorded telling another campaign aide that he destroyed a notebook recording the payoffs.

“It’s clear you lost your moral and ethical compass and your sense of fairness and honesty,” U.S. District Judge Colleen Kollar-Kotelly told Gore, 58, during a morning hearing. “In the campaign, you held a position of trust, and you abused it.”

In court papers, Gore admitted to participating in the scheme to pay candidate Sulaimon Brown to levy verbal campaign attacks on Fenty, the mayor at the time. Gore purchased money orders and gave them to the other aide, Howard L. Brooks, who gave them to Brown.

Brooks pleaded guilty to making false statements to investigators and in October was sentenced to probation.

D.C. corruption scandals: A look at the investigations and where they stand.

In pre-sentencing filings, prosecutors sought a six-month jail sentence, while Gore had asked for probation only.

Assistant U.S. Attorney Ellen Chubin Epstein told Kollar-Kotelly on Friday that the jail sentence would “restore some measure of public confidence in the integrity of the election system.”

Gore’s attorney, Frederick D. Cooke Jr., told the judge that his client’s long history as an advocate for underprivileged youths and families in the city justified a sentence without jail time.

“Mr. Gore is a pretty unique character in terms of his selflessness, his willingness to help others,” Cooke said. “He is absolutely tortured by his poor judgment.”

Cooke called Gore’s participation in the scheme and his decision to lie about it to investigators “almost impulsive,” adding, “That doesn’t mean it wasn’t wrong.”

Before he was sentenced, Gore read a statement apologizing for “exercising poor judgment” and “making a bad decision” and described his work in the community.

“I am sorry for bringing a distraction to that work,” he said. “I know I made a poor decision, and I take responsibility for it.”

Kollar-Kotelly acknowledged that work and discussed receiving letters that “paint a picture of a man devoted to his family and friends.” But she called Gore’s remorse “self-centered,” acknowledging his behavior’s impact on himself and his community work but not its role in corrupting the 2010 mayoral race and the political process at large.

“Without these fraudulent campaign contributions,” she said, “I believe it’s unlikely Brown would have been able to sustain his campaign as long as he did.”

The judge noted to Gore that District residents have “few electoral privileges, and your actions or inactions, I believe, set back the effort to secure greater electoral privileges.”

U.S. Attorney Ronald C. Machen Jr. said in a statement that the prison sentence “reflects the seriousness of [Gore’s] efforts to obstruct justice and subvert the democratic process.”

Gore declined to comment after the hearing. Cooke said that Gore “accepts the judgment of the court” and added that he believes the investigation to be ongoing.

Gore and Brooks are the only two people to have been charged in the Brown scheme; another Gray associate, public relations consultant Jeanne Clarke Harris, has been charged in connection with a separate “shadow campaign” alleged to have been funded by businessman Jeffrey E. Thompson.

Prosecutors have not alleged that Gray had knowledge of the payments to Brown, although Brown said in 2011 that the mayor knew of the payoffs. Court papers in the Brooks prosecution indicate that an unnamed “Person A” directed the payment of the money orders to Brown.

The Washington Post previously reported that that person is campaign chairwoman Lorraine A. Green, citing two people familiar with the investigation. Green has not been charged.

Gray has denied wrongdoing, and he declined to comment Friday on the sentencing of Gore, a longtime friend who was treasurer of his D.C. Council campaigns in 2004 and 2006.

Prosecutors requested that among the conditions of Gore’s sentencing he be banned from participating in future election campaigns without a judge’s consent. Gore did not contest the request.

“Mr. Gore has no intention of working in political campaigns again,” Cooke told the judge.