NASHVILLE, Tenn. — Nashville Mayor Megan Barry revealed Wednesday that she had an extramarital affair with the former head of her security detail, apologized and said she plans to continue serving in office.

In a news release, the mayor said she accepts full responsibility for the pain she caused her family and the family of Sgt. Robert Forrest, her former security chief. She apologized to her husband, Bruce, who she said remains committed to their marriage.

And she apologized to the people of Nashville, adding that she remains firmly committed to working hard to serve them. The popular mayor, who was elected in 2015, said progress has been made to offer affordable housing, improve to public education and promote better transportation options, but there's more work to be done.

She stood alone in front of TV cameras as she explained herself to reporters for about 15 minutes Wednesday night, telling them she's embarrassed, sad and sorry for all the pain she has caused.

She continued on to assure that nothing illegal happened and no policies were violated. Her office released records of her text messages, calendar and travel expenses and records, and Barry said she will be transparent in cooperating with possible investigations.

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

Mayor Megan Barry holds a news conference https://t.co/uH16TDD2ru — Tennessean (@Tennessean) February 1, 2018

"I know that God will forgive me, but that Nashville doesn't have to," Barry said during the news conference. "And I hope that I can earn their trust and I can earn your trust back, and that you will forgive me."

The first-term mayor's admission follows the painful loss of the Barrys' only son, Max, in July after an overdose on a combination of several drugs, including two opioids.

"This is a very bad day. And I'm going to have several more bad days. But this is not my worst day," Barry said Wednesday. "And I will tell you I know the difference between a mistake, I made a serious mistake, but this is not a tragedy."

God will forgive me, but the people of Nashville don’t have to. In the weeks and months to come, I will work hard to earn your forgiveness and earn back your trust. https://t.co/z5tNpBhjrW — Megan Barry (@MayorMeganBarry) January 31, 2018

She said the affair started several months after she came into her administration. She said it was discovered through conversations between their two spouses and personal conversations. She would not say when the affair ended, only saying that it's over.

She accumulated more than $33,000 in travel expenses combined between her and Forrest from January 2017 to late October 2017, and said all of the trips were business-related.

Forrest said on Jan. 17 he would retire Wednesday after 31-plus years with Metro Nashville Police. He spent 14 years of that tenure supervising the mayor's security detail over three administrations.

Related: Missouri Gov. Eric Greitens admits affair after blackmail accusations surface

In a separate news release Wednesday, Forrest said he never violated his oath as a police officer or engaged in actions that would abuse the public trust. The retired officer asked for privacy as he seeks to rebuild the trust of those he loves the most.

"I deeply regret that my professional relationship with Mayor Barry turned into a personal one," Forrest said in the release. "This has caused great pain for my wife, my family, friends and colleagues."

Barry also said she doesn't want this incident to "muddy" the "Me Too" women's movement.

"The 'Me Too' movement is about women who have been sexually harassed and economically disadvantaged for hundreds of years," Barry said. "This is about two middle-aged, consenting adults who had feelings for each other, and were human and had failings."