A man who sent sexual messages to what he thought were three young girls found himself confronted by so-called paedophile hunters at work, a court has heard. Mark Baker had in fact been communicating with decoy accounts set up on chat and social media websites.

Baker's barrister told Swansea Crown Court the 49-year-old had turned to dating websites as a "coping mechanism" to deal with feelings of isolation and low esteem, and had become addicted to them. A judge said he was not convinced the defendant had fully accepted the fact he had a sexual interest in children but he said he was persuaded that there was a realistic prospect of rehabilitation and that Baker could be managed in the community "with a strict package of measures".

Alycia Carpanini, prosecuting, said in September last year Baker contacted what appeared to be the profiles of three young girls on chat websites including Mingle. Despite the profiles making their supposed ages - 12, 13, 14, - clear to Baker, the defendant sent them a series of sexual messages, asked for photographs, and gave his phone number so they could chat on WhatsApp. The court heard that during the conversations Baker, who was using the name Aaron, told the supposed girls they were beautiful and sexy, said he wanted to touch them, and asked them whether they "played with themselves".

READ MORE: Mum accused of stealing daughters' £50,000 inheritance declines to give evidence at trial, leaving her 93-year-old dad to answer questions in the witness box

READ MORE:Off-road bikers who caused 'mayhem' in Mumbles told they face prison

The prosecutor said on September 22 members of the Dank Dragons paedophile group went to Baker's place of work and challenged him, and then called the police. In his subsequent interview the defendant said he was ashamed of what he had done but denied having a sexual interest in children.

Mark Baker, of Darren Road, Briton Ferry, had previously pleaded guilty to three counts of attempted sexual communications with a child when he appeared in the dock for sentencing. He has one previous conviction for one offence, that of causing death by careless driving. This conviction relates to a hit-and-run incident in June 2014 when lorry driver Baker knocked down and killed a cyclist on the A49 in Shropshire. Baker was sentenced to 26 weeks in prison suspended for 12 month at Shrewsbury Crown Court and was ordered to do 200 hours of unpaid work and complete a rehabilitation course.

Freddie Lewendon, for Baker, said the defendant's best mitigation was his early guilty pleas. He said a pre-sentence report detailed how Baker had used dating websites and apps as a "coping mechanism" for his feelings of loneliness, isolation and low self-esteem, and how they had became "somewhat of an addiction" for him. The barrister said the defendant no longer maintains his previous assertions that he has no sexual interest in children. For the latest court reports, sign up to our crime newsletter here

Judge Paul Thomas KC told Baker he had used a false name while communicating sexually with what he believed to be young girls, and he said he was not convinced the defendant had truly yet accepted the fact he had a sexual interest in children. The judge said on the basis of everything he had read about the defendant and with regard to the sentencing guidelines he was able to find there was a realistic prospect of rehabilitation and that the defendant could be managed in the community with a "strict package of measures". With a one-third discount for his guilty pleas Baker was sentenced to 16 months in prison suspended for two years, and was ordered to complete a Horizon sex offenders programme and a rehabilitation course. He will be a registered sex offender for the next 10 years and will be subject to sexual harm prevention order for the same length of time.

This interactive tool allows you to check the latest crime statistics for your area: