A York man who arranged to meet an underage girl for sex at a city hotel has been jailed after paedophile hunters confronted him at his home.

Andrew Carrington covered his ears in the dock as York Crown Court heard details of his Facebook messages.

Richard Herrmann, prosecuting, said the 56-year-old told the Facebook profile he believed to be a 13-year-old girl "I want to have sex with you" and asked what she would do if he raped her.

He suggested they met at a hotel in York for sex and said he would bring extra clothes in case he ripped hers. He went shopping for underwear in small sizes.

But the person behind the Facebook profile he thought was an underage girl was really part of a paedophile hunter group.

"He was confronted by members of this group, live streamed to their Facebook account," said Mr Herrmann. "The police were called and he was arrested".

Carrington had not actually gone to the hotel meeting he had arranged, having had a change of heart before it was due to happen, but not before the "girl" had booked rail tickets.

"It appears that he got cold feet," said Mr Herrmann.

Emily Hassell, for Carrington, said he was ashamed and extremely remorseful for his actions.

Because the anti-paedophile group had confronted him at his home and his local community had become aware of what he had done, he had moved out of York.

Carrington, now of Washbeck Close, Scarborough, pleaded guilty to attempting to arrange the commission of a child sex offence, attempting to engage in sexual communication with a child, attempting to incite a child into sexual activity and attempting to get a child to watch a sexual act. He had no previous convictions.

He was jailed for two years and put on the sex offenders' register and made subject to a sexual harm prevention order, both for 10 years.

The Recorder of York, Judge Sean Morris, told him: "You thought you were in a conversation with a 13-year-old girl. Thank heaven you were not."

The messages Carrington had sent to the decoy profile had been "filthy" but it hadn't corrupted a young girl because there was no young girl at the other end.

Mr Herrmann said Carrington sent a request to the profile saying: "Hi, do I know you?"

He got a reply that the girl in the profile was 13 years old. He very quickly turned the conversation sexual.

He asked the person he believed was an underage girl not to tell anyone about their conversation.

Ms Hassell said since his arrest more than two years ago, Carrington had completely stopped using the internet and no longer had devices by which he could access it.