Gardaí are to launch an investigation after a young teacher accused of defiling a teenage boy was photographed in court and the picture then circulated on social media.

The photo of the 24-year-old woman was allegedly taken by "either a journalist or a member of An Garda Síochána" as the teacher was sitting in the dock at Swords District Court.

Her solicitor, Emer O'Sullivan, applied for the photo to be ruled contempt of court.

However, Judge Dermot Dempsey said he could not make an order for contempt as it was not known who took the picture.

The photo was taken after the woman was charged with defiling a boy who was a student in her school at the time.

The judge had previously ruled the identity of the accused or any details that might identify the alleged victim could not be reported.

In her contempt of court application, Ms O'Sullivan said she did not know who had taken the photo. However, from the angle of the picture, it was taken either by a "journalist or a member of An Garda Síochána".

State solicitor Michael Durkan said the identity of the taker of the photo was required for a contempt issue.

Ms O'Sullivan said the accused's parents had called at a Garda station, and made a complaint about the photo.

However, gardaí said the parents had not made a formal complaint. Judge Dempsey said a formal complaint would have to be made by the accused and her parents.

The accused is next due to appear before the Swords court next month. It is alleged she engaged in a sex act with a child under the age of 17 last February 1 and February 13.