Two teenage boys have launched High Court challenges against their expulsions from school after they posted videos on social media of another pupil snorting a white powder substance during class.
Details of the incident, which the court heard involved the snorting of sugar, were published in an Irish daily newspaper, the High Court heard.
Last month the students, who cannot be identified for legal reasons, were informed the secondary school's board of management had decided they should be excluded from the secondary school they attend.
The board, which is due to formalise its decision later this month, found the students had behaved in a manner that posed a serious threat to the good order and discipline of the school after a classmate asked them to record him ingesting the white powder on their phones.
The incident occurred during the course of a lesson while a teacher was present.
The videos were posted on social media but were not believed to have been seen by many people.
The school was made aware of the videos by one of the boy's mother's, out of her concerns for her son and other student's safety.
Lawyers representing the boys say the board's decisions represent a fundamental breach of fair procedures and constitutional justice, disproportionate and the grounds for their expulsion fly in the face of common sense.
The board also failed to take into account the fact the school principal recommended the teens not be expelled.
It is also claimed the students were told to make statements without being warned the statements would be used against them in a disciplinary process and could be expelled.
In an effort to make the students provide a statement of events, it is also claimed they were told they would not be in any trouble.
At the High Court, Barney Quirke SC appearing with Andrew Whelan BL for one of the pupil's said that he was making the application because the student he represents is due to sit his Leaving Certificate examinations next June.
His client was already out of school and not receiving any education in what is a vital year for him. While it is intended to appeal the formal decision to expel the student, counsel said that process would take some time to complete.
Even if the appeal was successful, counsel said it could be well into the new year before the student could return to school, and a lot of valuable time would be lost.
Counsel said his client has special needs and has a good disciplinary record, which did not seem to be taken into account by the board.
His client did not know what substance the powder was, counsel said the student who ingested had subsequently said it was sugar.
Counsel said that despite the fact that his client's video was seen by a few people, the board seemed to take the view it had been widely published, had come to the attention of persons in neighbouring schools and the Irish Sun newspaper.
Derek Shortall Bl for the second student said his client's action was brought on similar grounds to the other boy, although his client had some previous disciplinary matters, including a suspension for swearing.
In their proceedings against the school's board of management, the boys seek various orders against the school including an order quashing the decision made last month to expel the boys and that they be readmitted to the school.
They seek declarations that the school's board of management also failed to make reasonable and appropriate provisions for their educational needs.
Permission to bring the actions was granted, on an ex-parte basis, by Mr Justice Seamus Noonan. The matter will return before the court on Thursday.