A police officer in Bartow, Florida was arrested after his wife turned him in for allegedly having sex with a 15-year-old girl, according to law enforcement.

Sgt. Randy Velez, 27, was arrested Wednesday and is being held in the Polk County Sheriff’s Office jail, Florida-based newspaper The Ledger reported. He is charged with one count of lewd battery, commonly known as statutory rape, and lewd molestation.

According to the Sheriff’s Office, Eloisa Velez, Randy’s wife, told investigators she had been aware that her husband had an affair in August, but she had not known the girl’s age until recently. She said her husband had confessed to her last week the girl had been 15 years old. The couple has been having marital issues over the past few months.

Staring April 27, Officer Randy Velez joined the Community Services Team for a Temporary Duty Assignment. This... Posted by Bartow Police Department on Tuesday, April 28, 2015

In a sting operation on Tuesday, deputies monitored a telephone call between Eloisa and Randy where he admitted that “he should be in jail, he is embarrassed, and he doesn’t feel good that he did what he did,” the arrest report stated.

Randy also told his wife he had the affair because “he didn’t like having someone who was always arguing with him.” He admitted that he wanted to have other affairs but that it took “planning” and “he just got lucky that day.”

The 15-year-old girl confirmed to detectives she had sex one time with the officer, and that the two had talked about being in a relationship together.

Tribal police officer found not guilty after tasing incapacitated man 28 times https://t.co/A2oe0TaQovpic.twitter.com/j1uSRHtzYm — RT America (@RT_America) December 19, 2015

After his arrest, Velez told detectives the girl “was nice to him, which made him feel comfortable around her.” He said he met the girl while on the job and they started talking together on Facebook as friends, but the more they “got to know each other, the more he started having feelings for her.”

They started talking about sex, he knew she was 15, and he came to her house at least once a day while working for a kiss, according to the arrest report. He came over twice when he wasn't working while her parents were not home. Velez admitted to detectives that he had sex with the girl on the second visit. He told investigators he couldn't recall if that happened in late August or early September.

US tennis star wants police officer fired after being cuffed by NYPD [VIDEO] https://t.co/IUnHRjZ17o@egorpiskunov_RT — RT America (@RT_America) September 15, 2015

Bartow Police Department said Velez had been with the agency since 2011 and was assigned to patrol. He resigned after his arrest.

"The Bartow Police Department is deeply saddened and disappointed by the alleged actions of Velez," the release stated, reported The Ledger. "The men and women of the Bartow Police Department are mindful of the trust and faith given by our community and wish to convey that the actions of this individual are not representative of our agency as a whole."

Velez was scheduled to be in court on Thursday. If he is convicted of rape and molestation, he could be sentenced to 15 years for each charge, and listed as a sex offender.