Legislators in 18 of Mexico's 32 states have approved a set of constitutional changes that will loosen congressional term limits and create a mechanism for annuling election results under certain circumstances.

Winning the blessing of a majority of state legislatures was the last hurdle for the package, which will now go to President Enrique Peña Nieto for his signature.

The law, which will enter into force in 2018, makes the office of federal Attorney General autonomous and establishes that Mexico's top prosecutor will be appointed by the Senate for a nine-year term, overlapping with the six-year mandate of the head of state.

In addition, it establishes the possibility of the president forming a coalition government.

If a coalition government is formed, its agenda and the Cabinet, with the exception of the secretaries of defense and the navy, must be approved by the Senate.

The reform includes the creation of a National Election Institute, which will take over some duties currently carried out by state-level agencies, and eliminates the ban on immediate re-election of state and federal legislators.

Federal lawmakers will be allowed to serve up to 12 years at a stretch.

In addition, the reform establishes the possibility of annuling an election for various reasons, including if campaign spending exceeds by 5 percent or more the sum authorized for that purpose and/or if illegally acquired resources are used. EFE