A decree published on Tuesday by the federal government banned marriage for children under 18 in 31 out of 32 states.
The decree annulled certain laws that allowed local authorities and families to provide exceptions or consent for child marriages.
Exceptions to the ban can still be granted in Baja California.
The National System for Protection of Children and Adolescents (Sipinna) celebrated the decree, saying it will help protect the rights of children.
“This will help promote a cultural change to eradicate forced marriages,” read a statement by the organization.
Since its creation in 2015, Sipinna has been advocating for a ban on child marriage, making alliances with international and national civil society organizations.
As of 2016, marriage was legal for boys as young as 16 and girls as young as 14 in 24 states. In some of the 18 states where child marriage was banned, the law contained provisions for families or local authorities to grant exceptions.
Almost 1.3 million child marriages take place in Mexico every year, making it one of the 10 countries with the highest number of cases. According to Save the Children, one in every five Mexican women get married before their 18th birthday, 73% of whom do not finish school. Child marriages also put women and girls at higher risks of physical and sexual violence.
But pressure has been mounting to ban child marriage in recent years. In March, the Supreme Court upheld a ban on on the practice in Aguascalientes from a challenge to its constitutionality. On May 1, the Chamber of Deputies approved a measure to ban child marriage at the federal level with near unanimity.