By Brooke Shafer

FORT LAUDERDALE (CBSMiami) – A Fort Lauderdale police officer found himself on the other side of the law Thursday morning when he faced a judge in bond court.

Officer Louis Walsh, 29, is accused of sexting with who he thought was an underage girl. Turns out it was an undercover detective.

READ MORE: Gabby Petito's Boyfriend Brian Laundrie Left Behind Wallet And Cellphone Before He Disappeared

During his court appearance, the judge set his bond at $70,000.

“He was a Fort Lauderdale police officer and that is concerning to the court given his position,” said the judge.

After posting bail, Walsh will need to wear an ankle monitor. He can’t use the internet or have a gun and must stay away from minors.

Walsh was arrested on Wednesday.

The Broward Sheriff’s Office says they received information from a Minnesota Human Trafficking Investigators Taskforce regarding a police officer in Fort Lauderdale engaging in online chats with someone he believed to be a minor.

READ MORE: Feds Pay First Florida School District For COVID-19 Mask Mandate

The officer was identified by investigators as Walsh.

Investigators said on at least two occasions, Walsh engaged in sexual conversations with an undercover detective who he believed was a minor female.

Detectives said Walsh sent a photo of himself, exposing his private area.

BSO detectives learned that Walsh had worked closely with students in the county. He worked special security details at Cardinal Gibbons High School, where he also coached wrestling, and at St. Anthony Catholic School.

On Wednesday, the Fort Lauderdale Police Department released the following statement:

MORE NEWS: Miami Weather: Partly Cloudy With Scattered Afternoon Storms Through Saturday, Cold Front Moves In Sunday

“This is a difficult situation for everyone involved. The Fort Lauderdale Police Department is shocked and disappointed to learn of the arrest of one of our officers. After an investigation by the Broward Sheriff’s Office (BSO), Louis Walsh was taken into custody on Wednesday. The details surrounding these allegations are very difficult to hear and do not reflect the character and professionalism expected of the men and women of this agency. Walsh has been placed on administrative leave without pay pending the outcome of a criminal investigation.”