Alabama Governor Robert Bentley has resigned after pleading guilty to two misdemeanors related to campaign finance violations.

The charges include failing to file campaign reports and converting campaign funds to personal use related to covering up an alleged affair Bentley had with a top aide, Rebekah Mason.

Bentley made a $50,000 loan to his campaign in November that investigators found he did not report for two months, according to AP. Per Alabama state law, large-dollar contributions must be reported within days.

Montgomery County Jail records listed each charge with a bond of $300.

The plea agreement states that Bentley must surrender almost $37,000 of campaign funds within a week and complete 100 hours of community service as a physician. He must also pay back $8,000 that he paid out of campaign funds to a law firm to represent Mason.

Bentley also agreed to give up his retirement fund and his security detail. The New York Times reported that resigning from office was also part of the plea deal.

In a televised speech, Bentley stated, “I have not always made the the right choices; I have not always done the right things.”

Lieutenant Governor Kay Ivey was sworn in as governor shortly after Bentley’s resignation.