MONTGOMERY, Ala. — Gov. Robert Bentley resigned Monday, his power and popularity diminished by a sex scandal that staggered the state, brought him to the brink of impeachment and prompted a series of criminal investigations.
Ellen Brooks, a special prosecutor, said Mr. Bentley had quit in connection with a plea agreement on two misdemeanor charges: failing to file a major contribution report and knowingly converting campaign contributions to personal use.
It was a stunning downfall for the governor, a Republican who acknowledged in March 2016 that he had made sexually charged remarks to his senior political adviser, Rebekah Caldwell Mason.
“I have decided it is time for me to step down as Alabama’s governor,” Mr. Bentley said at the State Capitol. He did not mention the charges to which he pleaded guilty, or the agreement with prosecutors that mandated his resignation.
His exit from government and guilty pleas followed mounting calls for his resignation, especially after a report that was made public on Friday said that he had fostered “an atmosphere of intimidation” and compelled state employees to help him cover up the relationship. Impeachment hearings — the first in Alabama in more than a century — began Monday morning, when the State House was consumed by rumors that the governor would soon quit.
Lt. Gov. Kay Ivey succeeds Mr. Bentley; she is a former state treasurer who will be the second woman to hold the office. She is graduate of Auburn University who was a high school teacher and a bank officer before going to work for the Legislature.
Mr. Bentley, 74, repeatedly denied having a physical relationship with Ms. Mason and long insisted that he had not broken any laws, but he was a subject of multiple investigations, including reviews by the F.B.I. and the Alabama attorney general’s office.
On Wednesday, the Alabama Ethics Commission said it had probable cause to find that Mr. Bentley had committed felonies, and it asked a district attorney to consider prosecuting him. Two days later, a lawyer hired by the Alabama House of Representatives released a report that portrayed Mr. Bentley as deceitful and desperate before his relationship with Ms. Mason made him a punch line.
The 131-page report said Mr. Bentley had offered little cooperation to legislative investigators, and it alleged that the governor’s critics had been subjected to coercion, including harassing messages and the threat of criminal prosecution. The report described how Mr. Bentley tried to use a member of his security detail to break up with Ms. Mason on his behalf and how the governor demanded that Ms. Mason be allowed to travel in official vehicles after she left the state’s payroll.
It also explored Mr. Bentley’s efforts to keep audio recordings of suggestive conversations with Ms. Mason from the public. In one such conversation, which rippled across the internet last year, the governor described embracing Ms. Mason and placing his hands on her breasts.
By the weekend, legislative leaders had demanded that the governor quit, echoing a faction of rank-and-file members in his own party who spent months vocally opposing Mr. Bentley. On Sunday night, the steering committee of the Alabama Republican Party made a similar call.
Yet until he announced his resignation, it was unclear that Mr. Bentley would actually abandon the job to which he was easily re-elected in 2014. Hours before the special counsel’s report became public on Friday, Mr. Bentley repeated his familiar pledge not to resign, and he pleaded for an end to the debate that stemmed from his personal conduct.
“The people of this state have never asked to be told of or shown the intimate and embarrassing details of my personal life and my personal struggles,” the governor said outside the State Capitol. “Those who are taking pleasure in humiliating and in shaming me, shaming my family, shaming my friends, well, I really don’t understand why they want to do that.”
Within days, Mr. Bentley resigned. The decision punctuated a sordid drama that exploded last year, prompting him to face renewed scrutiny about his 2015 divorce from Dianne Bentley, his wife of 50 years.
Ms. Mason declined to comment on Monday, as she has repeatedly done, and Mr. Bentley’s complaints and apologies over more than a year did little to quell public outrage in Alabama, where he had cultivated a reputation as an ethically sound public official. Now, he is the first Alabama governor to quit since 1837, when Clement Comer Clay left Montgomery to become a United States senator. (In 1993, Guy Hunt was automatically removed from office after being convicted of an ethics charge; he was later pardoned.)
Mr. Bentley’s resignation is the third major transfer of power in Alabama government since June, when the speaker of the House, Michael G. Hubbard, was convicted of ethics charges and forced from office. Later in the year, Chief Justice Roy S. Moore was suspended for the balance of his term for violating judicial ethics standards.
Mr. Bentley, a dermatologist, was a legislative backbencher until he stunned Alabama with his successful campaign for governor in 2010. In the early months of his tenure, he was widely praised for his response to a tornado outbreak that devastated much of the state. His policy legacy, at least among many Republicans, will be mixed. He opposed same-sex marriage and, within months of taking office, approved what was then one of the country’s most aggressive immigration laws. But he also called for higher taxes and, in 2015, surprised many people when he unilaterally ordered four Confederate flags lowered on the grounds of the State Capitol.
He also refused to endorse Donald J. Trump during the 2016 presidential campaign.
But Mr. Bentley’s personal conduct placed some of the greatest stress on his ties to members of his own party, and those conflicts worsened as the governor clung to power.
“It’s an embarrassment to the state, and I know we’ve made national headlines,” State Representative Corey Harbison, a Republican, said recently. “The governor thinks he’s the most loved right now as he’s ever been, and he has problems.”