PHILADELPHIA — Philadelphia's longest-serving sheriff was sentenced Thursday to five years in prison for using bribes from a businessman to help buy two homes and then awarding him millions in city contracts.

John Green, 68, admitted taking $675,000 from friend and businessman James Davis in exchange for $35 million in city work.

"This is the city that time and time again has been roiled by (this) kind of corruption," U.S. District Judge Wendy Beetlestone said. "You were supposed to be one of the good ones. The shame — your shame and the shame of the city — is that you were not."

Green, in court Thursday, only said he accepted responsibility for his crimes and was sorry for them.

He served more than 25 years as a police officer, and was the elected sheriff from 1988 to 2010. Prosecutors said Green had hoped to retire sooner, but Davis urged him to stay for at least another term.

"Each time John Green got elected, he maintained the business Jim Davis had and he increased it," Assistant U.S. Attorney Sarah Grieb said Thursday.

Much of the time, she said, "there were no contracts, no public scrutiny" of the city spending.

Davis bought and renovated a house in Philadelphia for Green before selling it to him at a loss; gave him $320,000 for the Florida retirement home; and paid his wife nearly $90,000 as a subcontractor. Davis was convicted at trial of tax fraud and is serving a 10-year prison term.

Green pleaded guilty this year to one conspiracy count while awaiting a retrial after a jury last year cleared him of some charges but deadlocked on others.

The case is the latest in a line of pay-to-play and corruption cases the U.S. Justice Department has brought against the Philadelphia's public officials. Former District Attorney Seth Williams and former U.S. Rep. Chaka Fattah are among those convicted and currently imprisoned.

In Green's case, federal investigators found that he surrendered "almost exclusive control" of the department's property sales to Davis, letting his firm handle the lucrative advertising work and padding the fees the firm received when people lost their homes.

"There was real harm in this case," Grieb said, mentioning the vulnerable homeowners. "Every dollar from the proceeds of their homes was important to them."