Three days after a British court ordered a developmentally disabled woman to have an abortion against her and her mother’s wishes, an appeals court overturned that decision, the mother’s lawyer said Monday.

Last week, a judge had ruled that an abortion was in the best interests of the unidentified woman, who is in her 20s, lives in London and has the mental capacity of a 6- to 9-year-old, according to evidence presented in court. The woman is 22 weeks pregnant, and the court was told that the circumstances of the pregnancy were unclear. British news media reported that a police investigation was underway.

In her ruling on Friday, Justice Nathalie Lieven of the Court of Protection said that although the case was “heartbreaking,” she had to act in the woman’s “best interests, not on society’s views of termination.”

The woman’s mother challenged that ruling, and on Monday three Court of Appeal judges overturned it, confirmed her lawyer, John McKendrick. He said the judges granted his client’s appeal after an “emergency last-minute hearing” on Monday.