A Texas man was arrested for allegedly posting online about wanting to sexually assault, kill and eat a child before he arrived with a knife and plastic trash bags at a meeting point organized by an undercover cop, according to Florida officials.

Alexander Barter, 21, of Joaquin, Texas, was arrested on Oct. 19 after an undercover agent from the Brevard County Sheriff’s Office saw a post online where Barter allegedly wrote he was looking for someone "who would allow him to commit necrophilia and cannibalism," according to a press release shared on Tuesday.

Alexander Barter, 21. Brevard, Florida Sheriff's Department

The officer, who is a member of a U.S. Immigration and Customs Enforcement’s Homeland Security Investigations Task Force, pretended to be an interested person and began messaging with Barter.

After messaging with Barter for several days, the agent said he had a child he could provide Barter with and Barter allegedly asked if he could kill the child, describing gruesome acts he wanted to perform, according to the release.

Barter then allegedly hatched a plan where he would meet the person and take the child to a rural area. There, the child would be "sexually assaulted, killed and then cannibalized," according to the press release.

The Brevard County officer traveled to Texas for the supposed meeting with Barter and the imaginary child. When Barter showed up for the meeting, he was arrested.

Police found a knife and plastic trash bags to transport the child's remains in Barter's possession, according to the press release.

Barter has been charged with criminal solicitation, criminal attempt of capital murder, conspiracy to commit capital murder and criminal attempt of sexual performance of a child.