arrest
Representational image of a man arrested by police at the McPherson Square in Washington, D.C., Dec. 4, 2011 JEWEL SAMAD/AFP/Getty Images

Florida’s Brevard County Sheriff’s Office said Tuesday a man who had planned to sexually assault, kill and then eat a child was arrested earlier this month with the help of an undercover agent.

According to a press release shared Tuesday, an undercover agent saw a post online where Alexander Barter, the accused, allegedly wrote he was looking for someone "who would allow him to commit necrophilia and cannibalism.”

The officer then pretended to be an interested person and began messaging 21-year-old Barter. After messaging him for few days, the officer told Barter he had a child he could provide. Barter asked the officer if he could kill the child. He also allegedly described the gruesome acts he wanted to perform.

Barter then made a plan to meet the officer and take the child to a rural area where the latter would be "sexually assaulted, killed and then cannibalized,” NBC News reported.

The officer, a member of a U.S. Immigration and Customs Enforcement’s Homeland Security Investigations Task Force, went to meet Barter in Texas and then arrested him.

“He showed up with a knife, with bags to take the individual body parts in. This is just a sick, demented individual that’s masquerading as a human being out there, preying on our children,” Sheriff Wayne Ivey said, NBC-affiliated television station WESH reported.

He called Barter extremely dangerous and thanked the officers for stopping him from what he said would be a monstrous crime.

"The dark web, and the individuals that operate there pose an increasing threat to the safety of our children," said Shelby County District Attorney Stephen Shires said, Florida Today reported.

"Technology has eliminated the barrier of distance for these sorts of activities. In this case, law enforcement mounted an integrated — state, federal and multi-state Texas/Florida — effort to deal with this particular individual. Hopefully, this will serve as a continued reminder that parents should always be vigilant and aware of what their children are doing on the internet," Shires said.

He also praised the officers saying, “I hope it also gives folks some comfort to know that there are also good guys at work — highly trained, highly capable individuals protecting us."

Barter was taken into custody Oct. 19 and charged with “criminal solicitation, capital murder, conspiracy to commit capital murder and sexual performance of a child.”

Federal and local law enforcement including Homeland Security, Customs and Border Patrol, the Texas Department of Public Safety, Nacogdoches Police Department and the Shelby County Sheriff's Office helped in the investigation, which was still ongoing.

He was currently in federal custody in Texas and could get life in prison if convicted.