A Texas man has been arrested for allegedly writing a post on the dark web seeking to commit necrophilia and cannibalism on a young girl.

Alexander Nathan Barter, 21, was booked in Shelby County, according to an affidavit which was obtained on Monday.

Barter allegedly made his intentions known to an undercover officer who was investigating him online, KTRE-TV reports.

The post written by Barter invites anyone willing to let him eat a young girl and then have sex with the corpse, according to authorities.

Alexander Nathan Barter, 21, was booked in Shelby County, according to an affidavit which was obtained on Monday

Barter also wrote two encrypted email addresses so as to allow others to contact him.

The post was discovered by an undercover agent working for the Texas Department of Public Safety.

The agent reportedly responded to the post by offering up his young daughter.

‘Nice! I’m in East Texas. How old is your daughter? Can we kill her?’ Barter is alleged to have written.

Barter then provided graphic details of things he would like to do to the girl before and after she dies.

Barter and the undercover agent exchanged a series of emails in which they planned to meet along with the officer’s ‘daughter’.

Barter allegedly made his intentions known to an undercover officer who was investigating him online

The post written by Barter invites anyone willing to let him eat a young girl and then have sex with the corpse, according to authorities. The girl in the photo above has no known link to Barter's arrest

The plan was to go on a ‘father and daughter’ hiking trip.

Instead of going on the hike, the daughter would instead be driven to a hotel, where she was to be assaulted, killed, and then cannibalized, according to the plan.

Barter allegedly told the undercover agent to buy a burner phone and new clothes to wear after the murder.

He even told the agent to concoct an alibi by claiming that his daughter ran away from home again.

On October 15, Barter allegedly wrote: ‘I’m not going to change my mind about this. I really want to do this.’

Investigators said they were able to trace the dark web posting to Barter by subpoenaing subscriber information and IP logs.

‘Nice! I’m in East Texas. How old is your daughter? Can we kill her?’ Barter is alleged to have written in an email to an undercover agent

They then contacted the internet service provider, which eventually led them to Barter, according to the arrest report.

The undercover agent and Barter set October 19 as the day they were meeting for their ‘trip.’

As Barter was on his way to meet the ‘father and daughter,’ he was instead accosted by a group of law enforcement officials outside his house.

Investigators found a plastic trash bag and a knife - items that he allegedly noted he would bring with him during his interactions with the undercover agent.

Court documents say that Barter admitted to investigators that he is the person who was communicating with the undercover agent.

Barter was placed under arrest and booked in Shelby County Jail.

He faces charges including criminal solicitation, attempted capital murder, conspiracy to commit capital murder, and attempted sexual performance of a child - all felonies.