THE RULING was clear. On September 7th Mexico’s Supreme Court unanimously voted to decriminalise abortion. The ten judges declared unconstitutional a law in Coahuila, a northern state, that imposes up to three years behind bars on women who undergo an abortion and the doctors who perform it. The ruling applies across the country. “Here ends the unjust criminalisation of women,” declared Arturo Zaldívar, the chief justice.

The loosening of abortion restrictions is the culmination of a small but growing wave of piecemeal liberalisation in Mexico, where almost all of the 32 states have outright bans, with narrow exceptions such as rape, fetal malformation or risk to the mother’s health. In 2007 Mexico City, the capital, passed a law allowing women to terminate their pregnancies on any grounds during the first 12 weeks. Since 2019 three other states had followed suit.

Pro-choice campaigners are celebrating. “We haven’t yet got there, but today a huge step was definitely taken,” tweeted Rebeca Ramos, who heads GIRE, a feminist outfit that has lobbied for liberalisation. Abortions will not immediately become available, but judges in all states can no longer prosecute women for having an abortion, and must release any women or doctors behind bars for terminating pregnancies (it is unclear how many there are). State congresses are not obliged to vote to change any relevant laws, but may do so, since they are now unconstitutional.

Decriminalising abortion in Mexico is significant—not least because it happened days after Texas introduced a law banning abortion after six weeks. The country of 126m is home to around 90m Catholics, the second-most in the world (after Brazil). But the church’s power has been waning. Estimates suggest around 1m clandestine abortions take place every year, with perhaps a third causing medical complications.

Along with these societal shifts, women in Mexico have become more vocal. Large protests have focused on the high incidence of violence, including record numbers of killings, suffered by Mexican women. (The court also ruled as illegal a provision in Coahuila providing lesser sentences for rape within marriage.) The judges’ reasoning was notable for its stress on women’s rights rather than technical legal questions as in some past cases.

The Mexican state, which is officially secular, is becoming somewhat friendlier to women in other ways, too. In 2019 it passed a constitutional amendment requiring federal and local governments eventually to have equal numbers of women and men in many jobs. Half of lawmakers are women, as is half of President Andrés Manuel López Obrador’s cabinet. But in other ways his government is less progressive. Mr López Obrador, who is devout, refused to get involved in the debate about the criminalisation of abortion, saying it was up to the courts to decide.

The president’s wariness is shared by many: in a poll in August 53% of Mexicans said they disagreed with legalising abortion, against 45% in favour. But Mr López Obrador has also dismissed female protesters as puppets of his conservative opponents. After he came to power in 2018 he cut funding for women’s shelters and for childcare that helped women go to work. He also got rid of a programme that gave cash to women as long as they sent their children to school and for regular medical check-ups. Although the abortion ruling is a significant step forward for women’s rights in the country, there is still plenty of room for improvement.