DETROIT — Mayor Kwame Kilpatrick pleaded guilty to felony charges Thursday in a sex scandal, forcing him out of office after months of defiantly holding onto his job leading the nation's 11th-largest city. He was ordered jailed for four months and fined $1 million.

"I lied under oath," Kilpatrick said in court.

The plea deal brings to an end a seven-months-long ordeal that has been a distraction for one of the nation's most troubled cities, which suffers from some of the highest home foreclosure and unemployment rates in the country, and has struggled for decades against population loss, high crime and racial tension.

The Detroit city charter automatically expels any mayor guilty of a felony.

A one-sentence letter signed by Kilpatrick and filed with the court states his resignation will take effect Sept. 18.

City Council President Ken Cockrel Jr. will succeed Kilpatrick as mayor until a special election is held.

Cockrel has had months to prepare for the possibility of taking over and made the rounds and shook hands at the Democratic National Convention in Denver, saying he was ready for the job.

As part of Thursday's deal, Kilpatrick is to serve four months in jail and five years of probation. The 38-year-old Democrat also would pay the $1 million in restitution over the five-year probationary period, cannot run for any elected office for five years and loses his law license.

No contest plea in assault caseDuring a separate hearing moments after Wayne County Circuit Court Judge David Groner accepted the mayor's plea, Kilpatrick offered a no contest plea in an assault case.

The judge also accepted that plea, which called for Kilpatrick to serve a four-month jail sentence that would run at the same time.

Kilpatrick had faced 10 felony counts in the two separate criminal cases.

Groner asked Kilpatrick if he understood he was giving up the right to be innocent until proven guilty.

"I gave that up a long time ago," Kilpatrick replied.

Kilpatrick also read a statement in court and admitted his guilt, saying "I lied under oath ... I did so with an intent to mislead the court and jury and to impede and obstruct the fair administration of justice."

Allegations of an affair
The married mayor and former top aide Christine Beatty were charged in March with perjury, misconduct and obstruction of justice. They're accused of lying under oath about an affair and their roles in the firing of a deputy police chief.

Beatty did not plead guilty and next will appear in court on Sept. 11. Groner said a plea deal in Beatty's case appeared likely.

The mayor will be sentenced on Oct. 28. He will report to jail that day, said Wayne County Prosecutor Kym Worthy.

"We did not give an inch and these conditions were basically to a letter of what we wanted all along," she said.

Worthy said she was glad that Kilpatrick resigned but that was never a "bargaining chip" for her. She said paying restitution and serving time in jail were far more important.

Democratic Gov. Jennifer Granholm described the events of the day as "a sad but historic story" that's coming to an end.

"A public office is entrusted to the person who holds that office but belongs to the people who are served by that office," she said.

She also suspended a hearing that she had started Wednesday to determine whether he should be removed from office for misconduct. The proceedings were rendered moot.

Until now, Kilpatrick had refused to resign even as the calls for him to step down grew louder and the controversy overshadowed all else at City Hall, tarnishing the national image of the much-maligned city even more.

Police chief steps downDetroit Police Chief Ella Bully-Cummings, who was appointed by Kilpatrick, announced her retirement Thursday, effective immediately.

Kilpatrick leaves a mixed legacy. He persuaded big business to invest in a city staggering from the auto industry's woes and a decades-long exodus of people, but he failed to live up to a promising political future due to repeated scandal.

The son of a Detroit congresswoman, Kilpatrick was just 31 when he was elected in 2001, becoming the youngest mayor in city history.

His pro-Detroit rhetoric and diamond stud earring endeared Kilpatrick to many blacks, especially young voters who embraced the "Hip-Hop Mayor."

But Kilpatrick's first term was marked by political immaturity and fiscal irresponsibility. He racked up thousands of dollars in travel on his city-issued credit card and the city's lease of a luxury Lincoln Navigator for his wife, Carlita.

Less than a year into the first term, rumors surfaced of a wild party involving strippers and members of Kilpatrick's security team at the mayor's mansion.

Former Deputy Police Chief Gary Brown filed a lawsuit in 2003, claiming he was fired for looking into the alleged party and investigating the actions of the mayor's bodyguards.

More text messages released in April revealed the evolution of flirty and sexually explicit exchanges to professions of love and promises of marriage.

In May, the City Council asked Granholm to remove Kilpatrick from office, saying it was misled into approving a $8.4 million settlement with Brown and two other officers. Council members said they didn't know about provisions to keep the text messages under wraps.

In July, a sheriff's detective trying to serve a subpoena on a Kilpatrick friend said he was shoved by the mayor. Assault charges followed.

The next month, a judge ordered the mayor to jail for violating the terms of his bond by traveling to Canada. He was released the next day, but the incident prompted some politicians and community leaders who had remained silent on the scandal to call for his resignation.

Copyright 2008 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.