The mother of a baby, who was placed in the custody of the Health Service Executive when he was just one day old, has failed in her legal bid to have the child returned to her.
The High Court ruled an emergency care order made by the district court last Thursday allowing the HSE to take custody of the child was valid.
The mother claimed neither she nor her lawyers had enough time to respond to the allegations made by the HSE.
Her lawyers said she was informed about the care order application on the evening before it was made.
The High Court was told by her lawyers that seven gardaí, in two cars and a van, had surrounded the house in which she was breastfeeding her baby last Thursday.
Senior Counsel Michael O'Higgins said this was done to ensure the woman and her baby did not leave the jurisdiction of the district court and this was another reason the care order was unlawful.
However, Mr Justice Sean Ryan dismissed their claim the child was taken into care unlawfully and unconstitutionally.
Mr Justice Ryan said it was "difficult to overstate the distressing nature of this case".
But he said he was satisfied from the evidence that the emergency care order was valid.
Lawyers for the mother, who was not present in court for the ruling, have said they will be appealing the ruling to the Supreme Court.
Under the terms of the care order, she has been given access to the baby for two hours a day for five days a week.
The court was told last week that the HSE had concerns about the child's safety primarily due to his father.
None of the parties involved can be identified by order of the court.
Mr Justice Ryan ruled that the mother and her legal team did not have enough time to respond appropriately to the allegations made by the HSE.
However, he ruled that was the nature of an emergency care application. Concerns about the baby's welfare outweighed the mother's rights to fair procedures.
Mr Justice Ryan said the welfare of a helpless and vulnerable baby was a most serious duty resting on the State when the primary carer or carers failed.
He said there were cases of children who had come to terrible harm or even death when social services had failed to act, although he was not saying this was the case here.
The judge said in this case the baby's interests and those of the mother appeared to be in conflict and that was the dichotomy at the heart of the case.
He said that even if he had found the care order to be invalid, he would have invoked Section 21 of the Child Care Act to ensure the child remained in the custody of the HSE for their own safety.