Nashville Mayor Megan Barry admitted Wednesday to having an extramarital affair with the former head of her security team. Barry, a Democrat, released a statement apologizing to her family and the people of Nashville, Tennessee.

"Today, I have acknowledged publicly that I have engaged in an extramarital affair with the former head of my security detail," Barry said in the prepared statement. "I accept full responsibility for the pain I have caused my family and his. I am so sorry to my husband Bruce, who has stood by me in my darkest moments and remains committed to our marriage, just as I am committed to repairing the damage I have done," she added.

The man in question, retired Sgt. Robert Forrest Jr. of the Metro Nashville Police Department, a 32-year veteran in the police force, subsequently admitted to having the affair with the mayor. Forrest also retired on Wednesday from the force, just hours before Barry released the statement, according to ABC-affiliate WKRN.

"I have had an outstanding career and have enjoyed coming to work each day," Forrest wrote in his resignation letter to Capt. Michael Alexander.

RTS8EUC Actor Tony Goldwyn (center) and Nashville Mayor Megan Barry (right) campaign with Democratic presidential candidate Hillary Clinton (not seen) at Meharry Medical College in Nashville, Tennessee, Feb. 28, 2016. Photo: REUTERS/Jonathan Ernst

The former head of security for the mayor made no reference to the affair in his resignation letter but later issued a statement through his lawyer, in which he confirmed their affair.

"I deeply regret that my professional relationship with Mayor Barry turned into a personal one," Forrest said in the statement. "This has caused great pain for my wife, my family, friends and colleagues. At no time did I ever violate my oath as a police office or engage in actions that would abuse the public trust."

Barry said she won't step down from her position as she didn't believe the relationship violated any Metro Nashville Police Department ethics laws or guidelines. She said it was a "consensual" relationship.

"This is a bad day, and there's going to be more bad days, but this is not my worst day," Barry said. "And I know the difference between a mistake — which is what I made and I fully own — and a tragedy. And this is not a tragedy. And I want to regain the trust of Nashvillians. And I will continue to serve."

Hired by Metro police on Nov. 16, 1986, Forrest served as a leader of the security team for a succession of Nashville mayors for 14 years. Forrest had no major investigations or transgressions during his time serving on the force, and there were also no open investigations looking into Forrest at the time of his departure.

At a press conference Wednesday night, the mayor revealed their relationship began several months after she took office in 2015. She said that their relationship was over after conversations with their spouses and the realization that it would become public. However, she did not clarify how things ended and when.

According to documents released by the mayor's office and obtained by WKRN, over $30,000 had been spent on Barry and Forrest's travel expenses since January 2017, and questions were raised after the mayor’s admission. The documents showed the mayor took a total of 30 trips during that time, nine of which were with the head of security alone.

Information from the Metro Nashville Police Department, also obtained by WKRN, stated that Forrest's overtime pay had doubled during Barry’s tenure.

At the press conference Wednesday night, Barry said "every single" trip was business-related and that Forrest's overtime pay matched her "aggressive schedule."

"When I came into office I set a very aggressive schedule because I wanted to be out in the community, be with people and be at events," the mayor told reporters. "I think you will see that lines right up with the overtime because we were out busy working."

She added, "There were no policies that were violated, nothing illegal happened. The records will absolutely show that the expenses match with the overtime expected. But I welcome anybody to take a look at that."

Barry, who was born in Santa Ana, California in September of 1963, had a successful political career with her effort in 2009 to pass a bill banning discrimination against city employees based on sexual orientation. Barry married a professor at Vanderbilt’s Owen Graduate School of Management. Their son, Max Barry, died in 2017 from an apparent drug overdose.

Some social media users criticized the mayor for her actions.