Former Alabama Governor Robert Bentley speaks after officially resigning on Monday, April 10, 2017, in Montgomery, Ala. Bentley resigned Monday rather than face impeachment and pleaded guilty to two misdemeanor campaign violations that arose during an investigation of his alleged affair with a top aide. (Albert Cesare/The Montgomery Advertiser via AP)

MONTGOMERY, Ala. (AP) — Alabama Gov. Robert Bentley resigned Monday rather than face impeachment and pleaded guilty to two misdemeanor campaign violations that arose during an investigation of his alleged affair with a top aide.

In a remarkable fall, the mild-mannered 74-year-old Republican and one-time Baptist deacon stepped down as the sex-tinged scandal gathered force over the past few days. Legislators turned up the pressure by opening impeachment hearings Monday. Last week, the Alabama Ethics Commission cited evidence that Bentley broke state ethics and campaign laws and referred the matter to prosecutors.

“There’ve been times that I let you and our people down, and I’m sorry for that,” Bentley said in the old House chamber of Alabama’s Capitol after he pleaded guilty.

The violations were discovered during the investigation of his affair but were not directly related to it.

In court, Bentley appeared sullen and looked down at the floor. He stood up and said “yes, sir” in a gravelly voice as the judge read out the charges he was pleading guilty to.

One misdemeanor charge against Bentley stemmed from a $50,000 loan he made to his campaign in November that investigators said he failed to report until January. State law says major contributions should be reported within a few days. The other charge stemmed from his use of campaign funds to pay nearly $9,000 in legal bills for political adviser Rebekah Caldwell Mason last year.

“He did what he did, and he deserves now to be called a criminal,” said Ellen Brooks, a retired district attorney overseeing the state investigation.

The resignation and guilty plea were a dramatic reversal from the man who on Friday stood on the Capitol steps and said he would not leave office because he had done nothing illegal.

The plea agreement specified that Bentley must surrender campaign funds totaling nearly $37,000 within a week and perform 100 hours of community service as a physician. The dermatologist also cannot seek public office again.

Bentley’s successor is Lt. Gov. Kay Ivey, who became Alabama’s second female governor. The first was Lurleen Wallace, wife of segregationist and four-term Gov. George C. Wallace. She ran as a surrogate for her still-powerful husband in 1966 when he couldn’t seek re-election because of term limits. She won, but died in office in 1968.

“The Ivey administration will be open. It will be transparent. And it will be honest,” Ivey said.

Bentley said in his statement that he no longer wanted to subject his family and staff “to the consequences that my past actions have brought upon them.” His staff gave him a standing ovation as he entered and exited the old House chamber.

Bentley’s resignation follows the ouster of former House Speaker Mike Hubbard, who left office in 2016 after being convicted on ethics charges, and former state Supreme Court Chief Justice Roy Moore, who was suspended from his post last year over an order opposing same-sex marriage.

Bentley, a staunch family-values conservative who won two terms partly because of his reputation for moral rectitude, was first engulfed in scandal last year after recordings surfaced of him making sexually charged comments to the 45-year-old Mason.

An investigative report prepared for the House Judiciary Committee and released last week said Bentley encouraged an “atmosphere of intimidation” to keep the story under wraps and directed law enforcement officers to track down and seize the recordings. The report portrayed the governor as paranoid and obsessed with trying to keep the relationship secret.

The committee on Monday started what was expected to be days of hearings.

Bentley lawyer Ross Garber had argued that impeachment should be reserved for only the “most grave misconduct,” noting that only two U.S. governors have been impeached since 1929, and both were indicted for serious felonies.

“It is not unusual for elected officials to have ethics and campaign finance issues. In fact, many governors face these things. It is very rare, though, for legislators to try to leverage those issues to impeach a governor. In fact, it is simply not done,” Garber told The Associated Press in an email.

The last U.S. governor to be impeached was Illinois Gov. Rod Blagojevich in 2009. He was removed from office and is now serving a prison sentence for conspiring to sell an appointment to President Barack Obama’s vacant U.S. Senate seat.

The investigative report contained text messages that the governor sent to Mason. They were intercepted by Bentley’s then-wife, Dianne Bentley, who was able to read the messages because they also showed up on the governor’s state-issued iPad, which he had given her.

“I sure miss you. I need you. I want you. You are the only one,” one message read.

Dianne Bentley divorced her husband in 2015 after 50 years of marriage.

Bentley denied having a physical relationship with his former aide, though in some of the recordings he talked about the pleasure he got from fondling her breasts.

At one point, according to the investigative report, the governor sent the head of his security detail to fetch the recording from his son Paul Bentley, who responded: “You ain’t getting it.” Dianne Bentley had secretly recorded her husband by leaving her phone on while she went for a walk.

The former first lady’s chief of staff also charged that Bentley threatened her job because he believed she had helped his wife make the recordings.

Former Law Enforcement Secretary Spencer Collier, who a day after being fired by Bentley last year held a news conference where he publicly revealed the affair accusation, said he feels vindicated by the resignation and plea deal.

GOP leaders in the House and Senate called on Bentley to resign, as has the Alabama Republican Party’s steering committee.

“It’s really time for us to look ahead and start moving forward on more pressing matters,” Republican Sen. Cam Ward said. “It was a constant distraction, one that was never going to change, and it’s time for us to get back to work.”

Two of Bentley’s predecessors in the past three decades have been convicted of crimes: Republican Guy Hunt in the 1990s, for misusing funds, and Democrat Don Siegelman, who was convicted of bribery in 2006.

___

Associated Press writer Jay Reeves in Birmingham contributed to this report.

____

This story corrects an earlier version that said two of Bentley’s predecessors went to prison. Former Gov. Guy Hunt was convicted, but did not go to prison. It also corrects that Bentley lawyer Ross Garber represented former Gov. Mark Sanford of South Carolina and Gov. John Rowland of Connecticut during impeachment proceedings, not Illinois Gov. Rod Blagojevich.