Embattled Gov. Robert Bentley this afternoon agreed to a deal that forced him to resign the office of governor, plead guilty to two misdemeanors and agree to never again hold public office.

The extraordinary agreement, hammered out over the weekend and throughout the day by lawyers for the Alabama Attorney General's office and Bentley attorneys Chuck Malone and Cooper Shattuck, requires Bentley to repay the state for misused funds and perform community service.

In response, the state attorney general's office will not pursue other felonies against Bentley, including those referred for prosecution last week by the Alabama Ethics Commission.

Bentley, as part of the deal, was expected to:

Resign immediately and leave public life.

Plead guilty to two campaign violations: converting campaign contributions for personal gain and failing to report campaign contributions.

Serve one year of probation.

Perform 100 hours of unpaid community service as a physician.

Repay the $8,912 his campaign spent on the legal fees of former aide Rebekah Mason, whose involvement with Bentley led to the charges against him.

Forfeit all the money in his campaign account, which is currently $36,912. The money will go into state coffers.

In response, the state attorney general's office will not pursue other felonies against Bentley, including those referred for prosecution last week by the Alabama Ethics Commission.

Whether the governor faces jail time on the misdemeanors - which are technically punishable by as much as a year in prison - is left to the judge who will sentence him. It is unlikely he will serve time.

Lt. Gov. Kay Ivey will, as the Alabama Constitution demands, ascend immediately to the governorship. Ivey, a Republican who was elected State Treasurer prior to her election as Lieutenant Governor, will become the first woman governor since Lurleen B. Wallace. Wallace, the wife of George Wallace, was elected in 1966 but died in office 16 months later.

Bentley held a press conference after being booked on his crimes, saying "I love this state from the bottom of my heart, and the people who live here."

Bentley's plea comes after a turbulent year and a catastrophic week for the governor. On Friday, facing public criticism and pressure from his own party, he vowed to remain in office.

"Once again let me say, I do not plan to resign," he said in an emotional press conference. "I have done nothing illegal."

But in many ways the writing was on the wall after the Ethics Commission on Wednesday found enough evidence to believe Bentley had committed four felonies, including a violation of the ethics act and three violations of the Fair Campaign Practices Act.

Those charges, which the commission forwarded to Montgomery County prosecutors, are each punishable by up to 20 years in prison. The attorney general's office, which has long been investigating, has the ability to take over those ethics cases.

Perhaps the most damage to Bentley came Friday, when the House Judiciary Committee - which has initiated impeachment proceedings against him - released the findings of lawyer Jack Sharman, who was hired to investigate Bentley and whether he used state money or resources to conduct or cover up an improper relationship.

The report was damning, including sworn testimony from current and former state employees who claim they were harassed and threatened as Bentley sought to keep the affair secret.

Tapes of conversations between Bentley and Mason were made public more than a year ago, after former Law Enforcement Secretary Spencer Collier revealed the affair. Bentley acknowledged making "inappropriate" sexually tinged comments to Mason, including now-infamous phrases about the way he liked to touch her breasts. Throughout, however, he has consistently denied having a sexual relationship.

The testimony and transcripts in the House report landed like a bomb Friday - even as Bentley lawyers went to court to stop impeachment proceedings and to prevent the report's release. That fight was expected to continue in filings before the Alabama Supreme Court today, but the plea deal renders them moot.

Alabama House Speaker Mac McCutcheon and Senate Majority Leader Del Marsh - both Republicans like Bentley - each asked the governor to resign last week, before the report was released. The Alabama Republican Party Steering Committee asked him to resign Sunday.

But Bentley on Friday - seeking to head off the release of the report - said he had made his peace with God and had moved forward. He chided those who would expose "personal details of my past personal life," and said there was no reason to do it except "vengeance, jealousy, anger or personal benefit."

But the release of the report - and its 3000-plus pages of exhibits - painted a dark picture of the governor. Sworn testimony from former staff members revealed a long-running affair, with questionable activities from improper use of state aircraft to intimidation of witnesses and campaign violations. The report revealed that Bentley's ex-wife, Dianne Bentley, made the recordings of the phone conversations when she began to suspect an affair.

The report did not just damage Bentley. It raised questions about Alabama Law Enforcement Secretary Stan Stabler, who has stood with Bentley and denied knowledge of an improper relationship. Sworn statements in the report say he was aware of the relationship and participated in many conversations about it.

Questions remain about other staffers and officials. It raises serious questions about the appointment of former Attorney General Luther Strange to the U.S. Senate. Strange as AG, asked the House Judiciary Committee to hold off on impeachment while his office investigated. Then he sought and received the Senate appointment.

It also raises questions about methods and links between the governor and the University of Alabama, and of companies that paid for the salary of Mrs. Mason. Ivey will determine the future of Mrs. Mason's husband Jon, who runs the governor's Office of Faith Based and Community Initiatives, also known as Serve Alabama.

Bentley joins a growing list of Alabama governors - three of the last six -- who have run into trouble with the law. Gov. Guy Hunt was convicted of misusing his inaugural account in 1993 and forced from office. Gov. Don Siegelman was convicted in 2006 of bribery while in office. He was only recently released from prison.

Sources say the plea by Bentley does not end the investigation surrounding the governor. The Attorney General's office, and special prosecutor Ellen Brooks, could pursue others who may have committed crimes.

Federal investigators have also investigated the Bentley affair, though many believe that investigation has grown dormant. A state plea deal would not affect a federal probe.

This story originally said PowerSouth paid the salary of Rebekah Mason. That is incorrect. PowerSouth paid the salary of former Chief of Staff Seth Hammett.

Bentley Plea Deal by Jeremy W. Gray on Scribd