GettyImages-914653366
The mayor of Nashville resigned after a sex scandal. Mayor Megan Barry speaks onstage during CRS 2018 Day 1 on February 5, 2018 in Nashville, Tennessee. Rick Diamond/Getty Images for CRS

For the first time in nearly 100 years, the mayor of Nashville, Tennessee, will leave office early. Megan Barry announced her resignation Tuesday on Twitter, following several weeks of controversy after she admitted to having an affair with her old head of security.

“It has been the honor and it has been the privilege of my entire professional life to have had the blessing of this opportunity to be your mayor,” Barry said in a written statement she posted online. The statement largely focused on her administration’s accomplishments while not specifically acknowledging why she resigned.

Half an hour before announcing her resignation, Barry pleaded guilty to felony theft of more than $10,000. She was sentenced to three years of probation and has to pay the city back $11,000 worth of illegal expenses she made throughout the course of her affair with Sgt. Rob Forrest, who also pleaded guilty to felony theft.

Barry announced her two-year affair with Forrest in January. Both Barry and Forrest were married at the time.

She started abruptly taking Barry with her as security detail on every official trip, a luxury she had declined before the affair started. Forrest accumulated hundreds of hours of overtime pay accompanying Barry to events and on trips, a possible misappropriation of taxpayer money.

At one point, authorities searched Forrest’s phone, discovering nude photos and chat logs that reportedly contained evidence of crimes. Barry claimed the photos were taken without her permission and were “a complete invasion of privacy.”

The Tennessean called it “a stunning fall from power” for Barry, who took office in 2015.

Barry, 54, had previously worked for telecommunications company Nortel Networks as well as Premier, Inc., a healthcare improvement company.

She is married to Bruce Barry, a Vanderbilt University professor. Their only son, Max, died of an apparent drug overdose in July at the age of 22.

Vice Mayor David Briley assumed the role of mayor after Barry’s resignation.

Nashville will have a special mayoral election in August.

The last Nashville mayor to leave office early was Felix Z. Wilson in 1923.

GettyImages-914653366
The mayor of Nashville resigned after a sex scandal. Mayor Megan Barry speaks onstage during CRS 2018 Day 1 on February 5, 2018 in Nashville, Tennessee. Rick Diamond/Getty Images for CRS