A 28-year-old man has narrowly avoided jail after pleading guilty to attempting to engage in sexual activity with a 13-year-old girl.

David Bleasdale was spared a custodial sentence by Judge Andrew Jefferies, after the court heard he'd been caught online trying to engage in explicit conversations, by a police officer who was posing as a 13-year-old girl.

During a hearing in Preston Crown Court, prosecutor Peter Barr explained that Bleasdale had been talking online to a teenage girl he presumed was called 'Maisie', between January and March 2019.

Mr Barr said: "On June 7 2018, as part of a nationwide operation carried out by the Metropolitan Police, an officer was instructed to create and assume the role of a 13-year-old girl and interact online with people with a view to gathering evidence regarding sexual abuse or potential sexual abuse of children.

"The officer created email and message accounts on Whatsapp, Skype and KIK and created a profile in the name of 'Maisie' who lived in London."

The court heard Bleasdale, who had a KIK account in the name of 'KingD daveb922, had sent 'Maisie' a private message on January 28 2019, which included an explicit photo.

The two engaged in a conversation, with 'Maisie' telling him her age before Bleasdale asked for naked pictures of her and suggested he would come to London to visit her.

Throughout the chat, another explicit image were sent to 'Maisie', with Bleasdale asking what size breasts she had and requesting she send him images of herself.

Mr Barr added: "'Maisie' refused to send the photos as she said her mother had walked in.

"Bleasdale then told her to delete the chat and delete him."

Further conversations ensued throughout February, and on February 28, Bleasdale sent 'Maisie' two images of a penis along with a woman who he claimed to be his girlfriend.

Enquiries led police to the defendant's address in Burnley, and on July 4 2019, Bleasdale was arrested and electronic devices including an iPhone were seized.

Analysis of the devices showed Bleasdale, who has no previous convictions, had deleted his KIK account and in his interview he denied all knowledge of the allegations.

Later he changed his story and accepted he was involved in chatting with 'Maisie' but he maintained that she was over the age of 18.

Judge Jefferies said: "You engaged in what can only be described as a very inappropriate sexual conversation with what you thought was a 13-year-old girl.

"I have to have regard for the fact that there was no 13-year-old girl but you didn't know that.

"If this had been a real girl, there would be a six month custodial starting point."

Bleasdale, of Burdett Street, Burnley, was handed a two year community order and will have to undertake 20 days rehabilitation activity, as well as being made subject to a five year sexual harm prevention order.