A North Carolina man was ordered to post $5,000 cash bond last week after allegedly arranging a sexual encounter in New Richmond with a teenager who turned out to be an undercover sheriff's deputy.

St. Croix County prosecutors on Nov. 28 charged 52-year-old Steven B. Bettinger with attempted second-degree child sexual assault, attempted child enticement and using a computer to facilitate a sex crime.

Bettinger posted bond Monday, Dec. 3.

READ MORE: Troopers say road conditions a factor in fatal Dunn County crashLundell announces resignation from bench

According to a criminal complaint:

A sheriff's deputy launched an Internet Crimes Against Children sex sting Nov. 26 by placing an ad on a website targeting adults who prey on children. The deputy used the persona of a 15-year-old boy from New Richmond.

Later that day, a user who later identified himself as "Scott" responded with a brief message and a photo depicting a partially nude male body. The deputy responded with a sexually charged email that explicitly states the persona is 15.

More exchanges were made, including "Scott" describing his sexual preferences. Eventually, a meeting was arranged near the New Richmond Culver's restaurant. "Scott" and the 15-year-old persona had agreed to perform a sex act.

Officers staked out the area and identified the vehicle the suspect was likely driving. They eventually rushed his car after confirming the driver was the one communicating with the persona over a message service.

Deputies arrested the driver, later identified as Bettinger, and seized numerous items in his car, including two iPhones, two computers, thumb drives, a passport and 16 condoms.

In an interview with investigators, Bettinger - who did not ask why he was being taken into custody after being approached by police at gunpoint - initially said he was driving from the Twin Cities to Duluth, Minn.

Later, investigators asked Bettinger why he thought he was sitting in jail.

"Probably because of an email," the complaint states he responded.

Bettinger admitted he was planning to meet someone "who told me he was young," according to the complaint. The email discussion involved a sex act, he said, and that while there was no confirmation, he told the investigator "there's always a possibility."

The investigator asked Bettinger if he had ever received child pornography. He said if he had, he would have deleted it immediately.

When asked by the investigator if he could search all the seized electronic devices, Bettinger requested a lawyer. The investigator told Bettinger he would apply for a search warrant.

A pretrial conference was set for Dec. 17 before Judge Michael Waterman.