Mexican President Enrique Pena Nieto has enacted a major reform of the education system that includes new standards for hiring teachers.
Under the changes, a census is to establish the exact number of schools, teachers and pupils in the country.
The reforms appear set to weaken the powerful teachers' union, led by Elba Esther Gordillo, which has largely controlled access to the profession.
The union has argued that reforms could lead to massive lay-offs.
Critics also say the changes could signal the start of the privatisation of education in Mexico.
But Mr Pena Nieto said the reform would maintain the free and secular nature of education.
"Professional merit must be the only way to be hired, and remain and advance as a teacher," Mr Pena Nieto said after signing the law.
Success should not be subject to "discretional criteria," he said.
The law foresees a centralised process for hiring, evaluating, promoting and retaining teachers.
Until now, the National Union of Education Workers (SNTE) has held sway over the criteria for being appointed and retained, a practice that has led to posts being inherited or sold.
The education system is believed to have thousands of phantom teachers on its books.
Ms Gordillo, who has led the SNTE for the past 23 years, and who was elected unopposed to another six-year term in October, was not present at Monday's signing ceremony.
"We are with the president in his efforts to modernise," Ms Gordillo said recently.
But she has also said that her union, which has some 1.5 million members, is ready to fight any attack on teachers' job security.
Ms Gordillo has rejected moves to link a teacher's continued employment to an evaluation.
Education reform was agreed by the major political parties, and approved by Congress and the majority of the legislatures in Mexico's states.
A key goal is to improve the educational achievements of Mexican pupils.
Mexico has one of the highest rates of pre-primary school enrolment among OECD countries, but only under half of students complete secondary education, according to an OECD report in 2012.