MEXICO CITY — Mexico’s Supreme Court has ruled in favor of a woman who complained she was denied access to an abortion despite suffering ill health during pregnancy.

The May 15 decision declared that denying a woman access to an abortion if her health is at risk violated the patient’s right to health, even though Mexico’s criminal code does not mention the health of the mother as a motive for allowing the termination of a pregnancy.

In the case, a woman identified as Margarita said she was diagnosed during her pregnancy with preeclampsia, a risk of diabetes and other potential complications, according to a video posted on social media by the Group on Reproductive Choice, which legally represented her.

The hospital, part of the social security network for government employees, denied her request for an abortion — which was later performed in a private clinic — because no provision in the criminal code allowed for it.

The court decision marked the latest in a series of rulings, which have incrementally expanded access to abortion. But it comes at a time when members of the ruling MORENA party and its political allies appear split on the issue.

None of Mexico’s 31 states has decriminalized abortion, though Mexico City allows it during the first 12 weeks of pregnancy.

Interior Minister Olga Sanchez Cordero has proposed the idea of Mexico adopting a unified criminal code for the entire country, which would require all states to adopt the abortion laws already implemented in Mexico City.

The issue has not advanced, however, and President Andres Manuel Lopez Obrador said in March, when asked about abortion, “There are many important issues and, at this time, I think the most important issue is cleaning corruption from government.”