MEXICO CITY (AP) -- Mexico's Senate overwhelmingly passed a sweeping reform of the notoriously dysfunctional public school system early Wednesday, handing President Enrique Pena Nieto an important victory in his push to remake some of his country's worst-run institutions.
The Senate voted 102-22 in favor of a standardized system of test-based hiring and promotion that would give the government the tools to break teachers unions' near-total control of school staffing.
That control includes the corrupt sale and inheritance of teaching jobs, and it has been widely blamed for much of the poor performance of Mexican schools, which have higher relative costs and worse results than any other in the 34-nation Organization for Economic Cooperation and Development.
"The inheritance and sale of jobs has ended," Education Secretary Emilio Chuayffet said on Twitter. "Merit is the ideal means of access to, and progress in, a teaching career."
The late-night vote clears a path for Pena Nieto to move forward with a series of even more controversial reforms, including a measure that would violate one of modern Mexico's longest-standing taboos by allowing private investment in the state-run oil company.
But there is potential trouble ahead.
Education advocates say a series of concessions to the smaller of the two main teachers unions undermined the reform's ability to create true change in the national education system.
And despite those concessions, the smaller teachers union continued days of debilitating demonstrations in Mexico City, sending tens of thousands of supporters to shut down the capital's main boulevard and protest outside key government building Wednesday. Thousands attended smaller protests in cities around the country. The union also pledged to throw its support behind a weekend protest against the oil reform by leftist leader Andres Manuel Lopez Obrador.
"When Congress is rendered void, the only thing that remains is the streets," leftist Sen. Mario Delgado said as a series of his Democratic Revolution Party's objections to specific measures of the reform were rejected in relatively narrow votes.
The education reform initially pitted Pena Nieto against the country's main teachers union -- Latin America's largest union and once one of the most important allies of his Institutional Revolutionary Party. The union, known by the Spanish acronym SNTE, fell into line after its head, Elba Esther Gordillo, was arrested on corruption charges in February. She remains jailed pending trial.
A smaller, dissident union known as the National Education Workers' Coordinating Committee, or CNTE, continued protesting and eventually rallied thousands of teachers from poor southern states, paralyzing large sections of the capital for more than a week.
In the end, the CNTE won a series of concessions that help protect its members. Reform advocates called the law an important first step but said much more remained to be done in order to change the system.
"It's not everything we would have hoped for but it's an historic change," said David Calderon, director of the education reform advocacy group Mexicans First. "Of course it's just a change in the rules that still has to be turned into reality."
Much of Mexico's educational dysfunction is attributed to the relationship formed more than a half-century ago between the Institutional Revolutionary Party and the teachers unions, which gained increasing control of the education system in exchange for throwing their strength behind the government in the voting box and on the streets.
Over the years the unions developed a virtual lock on teacher hiring and promotion. Almost every new teacher must go through a union to gain a school assignment, a practice that has spawned notorious levels of corruption, including the sale and inheritance of teaching positions.
Particularly in states with schools controlled by the CNTE, critics say, union influence has transformed schools from educational institutions into mechanisms for extracting funds from the state. The CNTE has become notorious for threatening elected officials with debilitating strikes and marches in order to maintain and increase benefits that make teaching one of the primary sources of legal income in much of rural Mexico.
Mexico today spends a greater share of its budget on education than any other member of the OECD except New Zealand. Out of that budget, the country spends more than 90 percent on staff compensation, again higher than any other member of the OECD. That spending doesn't translate into better results or smaller class sizes, however. Only 47 percent of Mexican children graduate from the equivalent of high school and Mexico also has the OECD's highest student-to-teacher ratio -- 25 pupils to every teacher, on average.