Governor Robert Bentley of State of Alabama resigned on Monday after pleading guilty to two campaign misdemeanors amid allegations that he misused public resources to pursue an affair with a former aide.

He was also accused of intimidating officials in an attempt to cover it up. Public allegations of an affair between Bentley and former senior political adviser Rebekah Caldwell Mason did not break out until March 2016, according to reports.

“I have decided it is time for me to step down as Alabama’s governor,” Bentley, a Republican who faced mounting criticism from his own party, said at the state Capitol shortly after he was booked into the Montgomery County Jail and released.

Shortly afterward, Lt. Gov. Kay Ivey, a former state treasurer, was sworn in as Alabama’s 54th governor, vowing that her administration “will be open, transparent, and it will be honest”.

As part of a plea deal, Bentley agreed to perform 100 hours of community service and repay his campaign fund 8,912 dollars. He also forfeited the $36, 000 in the campaign account. In turn, the state Attorney-General’s office will not pursue felonies against him.

Bentley, 74,had faced an impeachment move from his Republican legislators. He apologized to the citizens of the state. “I’ve always believed the honour of serving as your governor was a calling that God placed on my life.

“Though I have committed myself to working to improve the lives of the people of our state, there have been times that I have let you and our people down, and I’m sorry for that”.

Speculation about the governor’s inappropriate behavior began in August 2015, when Bentley’s wife of 50 years, Dianne, abruptly filed for divorce, stating in court records that their marriage had suffered an “irretrievable breakdown”.

Speculations became rife after Bentley fired the state’s top law enforcement official, Spencer Collier, saying that an internal investigation at the Alabama Law Enforcement Agency uncovered possible wrongdoing.

Within hours, Collier spoke out against the governor, alleging that he had seen and investigated sexual text messages and audio recordings between Bentley and Mason.

“When I stand behind you, and I put my arms around you, and I put my hands on your breasts and just pull you real close. I love that too,” Bentley said in one audio recording.

“If we’re going to do what we did the other day, we’re going to have to start locking the door,” he was also heard saying.

According to reports, Bentley made little effort to hide his relationship with Mason while at one point, he mistakenly sent a text message saying, “I love you Rebekah”, to his then-wife, Dianne.

Dianne also secretly recorded her husband speaking to Mason, reports said. Bentley, a state representative and dermatologist, was elected governor in 2010 and re-elected in 2014.