A 75-year-old man who was caught by a police internet sting after he tried to meet a child for sex has walked free from court after a judge decided not to send him straight to prison.

Suffolk police set up the sting with specialist officers pretending to be a 14-year-old boy online and John Wright was arrested after he arranged to meet the teenager at Bury St Edmunds railway station in November last year, Ipswich Crown Court heard.

Richard Kelly, prosecuting, said that Wright sent the “boy” pictures of his private parts over the internet and arranged to meet him through the dating app Grindr.

However, when Wright, who had brought condoms with him, arrived at Bury station he was met by police officers and arrested.

Wright, of Rye Gardens, Little Downham, Ely, admitted attempting to incite a child to engage in sexual activity and was given a 16 month prison sentence suspended for two years.

Hewas also ordered to take part in the Thames Valley Sex Offenders’ Treatment Programme and a 40-day rehabilitation activity requirement.

He was further ordered to do 80 hours unpaid work in the community and was made the subject of a sexual harm prevention order and ordered to sign the sex offenders’ register for ten years.

Wright was ordered to pay £1,200 costs and a £140 victim surcharge.

Wright was former Grand Master of the Grand Council of Royal and Select Masters and also Grand Master of the Provincial Grand Lodge of Mark Master Masons of Essex. He resigned irrevocably from Freemasonry with effect from December 1, 2016.

Sentencing him Judge Martyn Levett said Wright had no previous convictions and while a prison sentence would deal with reducing the short term risk he posed the TVSOTP would aim to reduce the risk of him reoffending in the future.

Judge Levett said Wright had genuinely believed the person he was communicating with and was arranging to meet was a real boy and had made sexual references during their exchanges. “There was a significant difference in your ages,” said the judge.

Judge Levett said Wright had asked the “boy” if one of his friends wanted to “join in” and he said he didn’t accept that Wright wasn’t sexually attracted to children.

He warned Wright he would go to prison if he breached the suspended sentence order.