Former Philadelphia District Attorney Seth Williams, once seen as a future star of the Democratic Party, is now on his way to a federal prison cell where he will serve five years for selling the power of his office to moneyed donors. The onetime top prosecutor admitted to accepting posh dinners and Caribbean getaways in return for favors.

“Mr. Williams, you sold yourself to the parasites you surrounded yourself with,” said U.S. District Judge Paul Diamond. “You harmed all of the citizens of this city.”

Diamond ordered Williams to start his sentence immediately Tuesday, rejecting Williams’ request that he visit his elderly mother, saying “the English language doesn’t have the word to capture the outrageousness of that request.

“Whether it’s gall or hubris, brass, audacity … the defendant stole from his mother and now wants to visit her,” Diamond said. “Your request is denied. He will remain in custody.”

Just before the sentence was imposed, Williams, wearing a brown T-shirt and sweatpants, wiped a stream of tears away as his lawyer, Thomas Burke, read a statement Williams prepared.

“I owe you an apology, the people of Philadelphia,” Williams wrote. “Being the first African-American DA was a privilege. I squandered that responsibility.”

After the statement was finished, Diamond remained unmoved, saying, “I do not find it credible. It sounded like a campaign speech.”

In June, Williams abruptly concluded his trial two weeks into the proceeding by pleading guilty to one of 29 corruption counts he faced. In addition to accepting lavish gifts from benefactors, he admitted stealing money meant for his mother’s nursing home care to support a high-flying lifestyle that was beyond his means.

In exchange for escaping conviction of 28 other charges, Williams waived his right to appeal the conviction, though he did admit to the underlying conduct of all the other counts.

In a surprise move, Diamond told the court in June that he was “appalled” by the evidence prosecutors presented against Williams, and he worried that Williams posed a flight risk. “I do not believe him,” Diamond said.

Diamond then ordered U.S. marshals to immediately arrest Williams and take him into custody. Since then, he has been awaiting sentencing in a Center City prison.

‘Merely a thankful beggar’

During the trial, humiliating details about Williams’ personal life were aired in open court as dozens of freewheeling text messages over several years were read aloud. In one of them, Williams described himself to a gift-giver as “merely a thankful beggar.”

In the one count for which Williams will now be serving time, he admitted to taking gifts from Bucks County businessman Muhammad Ali, called Businessman No. 1 in the indictment federal prosecutors filed in March.

Those perks included a vacation at a Punta Cana resort worth $6,000 complete with parasailing and Swedish massages. Ali also bought Williams a custom $3,200 chocolate-colored sectional couch from Raymour & Flanigan. And an iPad and Burberry watch to boot.

In return, Williams attempted to make it easier for Ali to get through airport security by writing letters to federal officials on official district attorney letterhead.

Williams also took steps to lessen the punishment of a friend of Ali’s who was facing drug and gun charges. Although Williams’ efforts did not alter the outcome of that case, prosecutors said the attempt was enough to show Williams was selling the power of the district attorney’s office.

Williams’ defense team labored to show that the district attorney and the gift-givers maintained real friendships — and that the fact that the businessmen were supplying the former city prosecutor with gifts was indicative of friendly appreciation, not a bribery attempt.

Voters will decide Williams’ permanent replacement next month, when former civil rights attorney Larry Krasner, a Democrat, faces off against Republican Beth Grossman, a former prosecutor.

The office of the district attorney since Williams resigned from his post has been overseen by interim District Attorney Kelley Hodge.