LONDON — A British court has ordered an abortion for a mentally disabled woman against her and her mother’s wishes, with the judge calling the decision “heartbreaking” but in the best interests of the woman, who is 22 weeks pregnant.

The unidentified woman, who lives in London, is in her 20s and has the mental capacity of a 6- to 9-year-old child, according to evidence presented Friday at the court in London. The circumstances of the pregnancy were unclear, the court was told, and a police investigation was underway, according to news reports.

The decision was first revealed by the Press Association and other British news media, including The Catholic News Agency. The woman and her family were not identified, and neither her family nor her lawyers could be reached for comment. But a spokesman for the court confirmed public details of the case by email on Sunday, including the court proceeding and the judge’s comments.

Justice Nathalie Lieven handed down the decision at the Court of Protection, which hears cases on issues relating to people who are considered to lack the mental capability to make decisions for themselves.