A man has been jailed for two years and three months after taking drugs and having sex with a teen trans boy he met on Grindr.

Andrew Castles, 28, from Melbourne, admitted he met the 14-year-old transgender boy in July 2017 after the two started speaking on the hook-up.

Despite the boy’s profile saying he was 18, Castles found out the boy was only 14 but still insisted that they meet for sex and take drugs, thenewdaily.com.au reported.

Castles agreed to pick up the teenager from the victim’s care facility to ‘avoid being seen’. When they met, he gave the child a 0.5ml dose of GHB before sexually penetrating him over a three-hour period.

The court heard that at one stage the condom broke but Castles continued to penetrate the teenager before he was given another 0.7ml of the drug.

When the child was asleep on the couch, Castles reported took a photo of the naked teen and put it as the image to his mobile number.

Castles allegedly told a forensic psychologist that he started having sex with men when he was younger than the teenager and “I thought it would be safer if he learnt with me”.

Defence barrister, James Westmore, argue that “consent” was given as the child was looking for sexual encounters on Grindr.

However, on Friday (March 1), County Court of Victoria Judge Paul Higham said consent could not have been viewed by the court as meaningful.

Higham said: “The online world is filled with temptation. And when we go onto the online world, Mr Castles, we must take with us our moral compass.

“That means we must take with us our sense of what is right and what is wrong. And you knew your conduct was wrong.

“Your initial reaction when told of your victim’s age was, ‘Oh shit’. That was the right reaction.

“You were driven by your desire, by your own sexual gratification.”

Castles pleaded guilty to two counts of sexual penetration of a child under 16, supplying a drug of dependence to a child and producing child abuse material.

He was sentence to three years and 10 months’ imprisonment, with a non-parole period of two years and three months.