Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The 'Love Gov' is stepping down to avoid impeachment but was charged Monday with two counts of violating state campaign laws.

The resignation of Alabama Gov. Robert Bentley came amid allegations that he tried to cover-up an adulterous affair with a former adviser. He announced the move on Monday night, shortly after being booked on two campaign-related charges — failure to file campaign disclosures and failure to disclose economic interests.

Bentley, who was replaced by Lt. Gov. Kay Ivey, was released after posting $600 bond.

"I've always believed the honor of serving as your governor is a calling that God placed on my life," Bentley said in announcing his resignation. "Though I have sometimes failed, I have always tried to live up to the high expectations that people place on the person who holds this esteemed office. There have been times that I have let you and our people down, and I’m sorry for that."

He added, "I can no longer allow my family, my dear friends, my dedicated staff and cabinet to be subjected to the consequences that my past actions have brought on them.

“I want you to know, I love our people with all my heart."

The Associated Press reported that Bentley first announced his resignation during a Cabinet meeting Monday afternoon.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Ivey, 72, will be the second woman to be governor of Alabama when she is sworn in Monday evening, the sources said.

Bentley pleaded guilty two to the two charges, both misdemeanors, according to District Attorney Ellen Brooks. Court documents released Monday show that he agreed to reimburse nearly $9,000 in campaign funds, pay $7,000 in fines, resign his post and not seek public office.

Bentley also agreed to surrender nearly $37,000 in campaign money and to put his skills as a physician to good use: he will perform 100 hours of community service as a medical doctor.

Bentley's exit comes as the state's House Judiciary Committee wrapped up its first day of impeachment hearings following the release of a tawdry report detailing the governor's alleged affair with Rebekah Caldwell Mason.

Alabama Gov. Robert Bentley appears in a police booking photo released on April 10. Montgomery County Sheriff's Office

It revealed, among other things, that the governor's now ex-wife, Dianne, found the tell-tale texts, including one in which Bentley professes his love for Mason — but mistakenly sent it to his wife of 50 years.

The report also included revelations that Bentley routinely called Mason "baby" in meetings, that Mason sometimes spent the night in the pool house at the Governor's Mansion, and about how the governor on a trip once opened a door while wearing only boxer shorts thinking that she was there only to be confronted by hotel staffers.

Bentley "encouraged an atmosphere of intimidation" to silence his staff and "protect his reputation," the report stated. And neither the governor nor his staff "meaningfully" cooperated with the investigation, which could be grounds "for his impeachment."

A 74-year-old grandfather of six from Tuscaloosa who sometimes teaches Sunday school, Bentley has denied sleeping with Mason, a married mom nearly three decades younger than him. He also denies punishing the police officer who blew the whistle on their alleged adulterous affair. And he has asked God to forgive him.

Bentley's decision to quit came after the Alabama Republican Party's steering committee passed a resolution urging him to "resign immediately."

Alabama Governor Robert Bentley speaks with former aide Rebekah Mason. NBC News

The scandal that took Bentley down erupted in March 2016 when Alabama's former top cop, Spencer Collier, claimed he got canned because he refused to cover up the alleged illicit romance.

Bentley admitted he "made a mistake" but refused to be pinned down when asked if he and Mason had done more than exchange sexy texts. And he denied Collier's claim that he leased a state plane to so Mason's name would not appear on flight manifests.

But Bentley admitted making "inappropriate comments" and steamy excerpts of a telephone conversation between him and his aide — that was surreptitiously recorded by Dianne Bentley and her trusted aide — raised eyebrows all across Alabama.

Within months, 23 state representatives — most of them Republicans, like the governor — signed impeachment articles accusing Bentley of corruption and neglect of duty.