A British woman who trapped her pedophile husband by posing as a teenage girl on the internet has been praised by a children's charity, Sky News reported.

David Anthony Roberts, 69, asked a girl he believed to be aged 14 to have sex with him, not realizing he was having an online conversation with his wife Cheryl.

Cheryl Roberts was so shocked she called in the police and The National Society for the Prevention of Cruelty to Children, who discovered indecent images of children on his computer.

Her husband admitted to police he would have been prepared to have sex with the 14-year-old from the internet chatroom if she had agreed to meet up with him.

David Roberts, of Bridgend, south Wales, was sentenced at Cardiff Crown Court on Thursday and ordered to attend a program for sex offenders as part of a three-year community order.

He must also register as a sex offender for five years and is banned indefinitely from having contact in person or online with children under the age of 18.

Click here for more from Sky News.