A separated man who had sexual encounters with three underage girls a year after he was caught with child pornography has had his sentence adjourned to next month.

David Masterson (54) who is originally from the Tallaght area of Dublin but has been on remand in custody since September 2017, met the three girls through a teenage boy who had linked in with the victims on social media.

Detective Garda Colin McKiernan agreed with Paul Carroll SC, defending, that this teenage boy had gone online “ looking for sexual experiences for payment and roped these girls into this situation”.

One of these girls, who was 17 at the time, started a relationship with Masterson in February 2016 and continued seeing him after she turned 18. The detective confirmed that there were multiple sexual encounters between Masterson and this girl during that time.

Masterson pleaded guilty at Dublin Circuit Criminal Court to three charges of defilement on dates between February 2016 and December 2016 and charges of possession and distribution of child pornography on November 14, 2015.

He has one previous conviction for a road traffic offence.

Det Gda McKiernan told Garrett McCormack BL, prosecuting, that gardaí were called to “an incident” during a New Year’s Eve party in December 2016, which Masterson and some of the victims were attending, and an investigation was launched.

He said the girls later gave statements and confirmed that Masterson had sex with one of them while she was 17 years old and had engaged in oral sex with another girl when she was 15 years old.

The other girl confirmed that she and Masterson were in an ongoing sexual relationship before she turned 18. There were no victim impact reports before the court.

Det Gda McKiernan confirmed that Masterson’s rented home was searched in November 2015 following confidential information and a laptop was seized.

The court heard that 5,121 images were discovered on the laptop, 3,846 of which showed pre-teen boys and girls engaging in sexual activity with adult males.

The images included a baby girl being assaulted, another girl being urinated on and a third girl with her limbs bound in chains and a plastic bag around her head.

Det Gda McKiernan said 196 videos were also found, 176 of which showed pre-teen boys and girls having sex with adult males, including one during which a child can be heard screaming while she was strapped down and raped.

Masterson also admitted sharing one video that was later sent back to him.

Judge Martin Nolan adjourned the case to December 20, this year, and ordered the preparation of a both a psychological and a governor’s report for that date.

He heard that Masterson has not taken up his bail since he was remanded in custody over two years ago.

Det Gda McKiernan agreed with Mr Carroll that previous to the search of his home, Masterson was not on the garda radar and had lived “a fairly normal life” having worked for a semi-state body for 20 years and been married for 26 years.

He accepted that Masterson told gardaí during interview in relation to the child pornography that he was lonely following the breakdown of his marriage.

Det Gda McKiernan agreed that “things had started going off the rails” for Masterson.

Mr Carroll said that during a recent consultation with Masterson he “divulged certain matters” relating to something that happened him in his own youth.

He asked for the case to be adjourned to allow for the preparation of a report to deal with these issues.

Counsel said his client was “finished in terms of his family, finished in terms of his friends and finished in terms of his work”.

“He is a man who literally went off the rails at a late stage in his life when he had just turned 50 and continued on that trajectory in terms of his serious offending,” Mr Carroll submitted.