An Australian man avoided jail time despite pleading guilty to dozens of sexually-charged internet discussions with underage girls. Ashley Brian Foster, 25, pleaded guilty to two counts of grooming a child under the age of 12 and 44 counts of grooming under the age of 16.

Appearing at Southport District Court on Monday 9 October, Foster was handed a four year jail sentence for the two counts of a child under the age of 12 – but that term was suspended for five years.

He was granted immediate parole on a three year jail term for the charges relating to under 16s. Foster's crimes were found during a drugs investigation by police, who stumbled across child exploitation images on his phone in 2014, the Sydney Morning Herald reported.

The discovery allowed police to find the full conversations between Foster and the children when he had pretended to be a teenage boy.

Judge David Kent said that although Foster couldn't have known for certain what gender the children were, he did know that they were underage and that their conversations were "lewd and depraved and unrestrained".

He avoided prison due to his substantial rehabilitation efforts in the years since the discovery was made on his phone. The court heard that at the time of the offences, he had been battling and addiction to ice, a form of methamphetamine.

A report from a psychiatrist suggested that his behaviour was "acute substance-induced psychosis" and wasn't the typical behaviour of a paedophile.

Since his initial arrest in 2014, the judge noted that Foster had transitioned from an addict to someone who was now happily married with his first child on the way. "Your rehabilitation is greatly advanced during the unexplained delay since the commission of the offence," Judge Kent said.