A man whose own father reported him to police for having sex with a 14-year-old girl had dreamed of becoming a policeman.
Phillip Barr, 20, posed as a 17-year-old boy over social media and convinced the girl to have sex with him in a car.
He later visited the girl at her home and was found hiding in her wardrobe by her brother.
When his “horrified” father found out, he escorted him to police headquarters.
Barr, who works as a boat builder and still lives at his family’s Forfar home, has been placed on the sex offenders register and said his sentence should serve as a warning to other men.
He said: “It was a total mistake and I’ve pretty much ruined my life. It has stopped me from doing what I wanted to do.
“I am trying to rebuild my life. I had always wanted to go into the police and although that sometimes changed it was pretty much what I wanted to do.”
Depute fiscal Vicki Bell told Dundee Sheriff Court that Barr had known the girl was only 14 from the outset.
He communicated with her via Snapchat and had unprotected sex with her in a car on February 9 last year.
Barr, 20, of Fyfe Street, Forfar, pleaded guilty on indictment to a charge under the Sexual Offences (Scotland) Act committed on February 9 last year.
Defence solicitor Nick Whelan said Barr himself, along with his father, had reported the matter to the police and that otherwise it might not have come before the courts.”
Sheriff Alastair Carmichael sentenced Barr to a community payback order of 18 months, 160 hours of unpaid work, a six-month restriction of liberty order and placed him on the sex offenders register for 18 months.
Sheriff Carmichael also imposed a conduct requirement which states that Barr is to have no direct contact with any child under 17 and his software and internet use and devices are to be approved by supervising officers.
He said: “This is a very serious offence and one that is definitely within the custodial range.
“A community payback order would be appropriate, however it must be alongside a punishment element such as unpaid work and a restriction of liberty order.”