(CNN) -- Former Detroit Mayor Kwame Kilpatrick on Thursday was sentenced to 28 years in prison after he was convicted in March of two dozen federal charges.
The charges include racketeering, extortion and the filing of false tax returns. He was accused of using the mayor's office to enrich himself and associates.
Before he was sentenced, Kilpatrick apologized in court Thursday morning.
"I say with every morsel of my being that I'm sorry to you," he said.
Judge Nancy G. Edmunds noted the apology and said that he was showing "more awareness than I have seen along the way."
But she said "a long prison sentence is necessary to insulate the public from his behavior."
"That way of business is over. We're done. We're moving forward," she said.
Kilpatrick, Detroit's mayor from 2002 until he resigned in 2008, was the biggest target of a years-long Detroit City Hall corruption investigation that led to the convictions of two dozen people, including several of his closest friends and former City Councilwoman Monica Conyers, the wife of U.S. Rep. John Conyers.
Federal prosecutors alleged that Kilpatrick ran a criminal enterprise through the mayor's office to enrich himself through bid rigging and extortion, and using nonprofit funds for personal gain.
At the heart of the scheme was corruption in municipal contracting, mostly centering on the Detroit Water and Sewerage Department, said Barbara McQuade, U.S. attorney for the Eastern District of Michigan.
Edmunds said that in the sentencing, she was not holding Kilpatrick responsible for the city's bankruptcy of this year, saying that was due to wider factors. But then she cited a litany of effects of his crimes, including loss of public trust and honest contractors being turned away.