Updated

Mexico's Supreme Court invalidated a controversial law signed last year that created a legal framework for the military to work in a policing role in much of the country, ruling Thursday that the measure violated the constitution by trying to normalize the use of the armed forces in public safety.

Deep-rooted corruption and ineffectiveness among local and state police forces has led Mexico to rely heavily on the military to combat drug cartels in parts of the country.

But military commanders have long expressed uneasiness about what was essentially an open-ended policing mission. The armed forces have been implicated in a number of human rights abuse cases.

On Wednesday, President-elect Andres Manuel Lopez Obrador announced a security plan that would also lean on the military. He proposed forming a National Guard initially made up of elements from the navy and army police as well as federal police.

After drawing a raft of criticism, especially from human rights groups, Lopez Obrador sought on Thursday to distinguish between his plan and his predecessors'. He said congress would seek a constitutional reform to allow it.

"Because I don't want to use the army and the navy like they have been doing for public safety work if they are not authorized to carry out those functions," Lopez Obrador said.

But the international human rights group Amnesty International said the Supreme Court's decision should cause Lopez Obrador to rethink his security plan.

"The declaration of unconstitutionality of the Internal Security Law appears to open an opportunity for the government of President-elect Andres Manuel Lopez Obrador to develop a detailed plan for the prompt and orderly withdrawal of military forces from their security work," Erika Guevara Rosas, Americas director for the group, said in a statement. "It is worrisome that the president-elect has presented a security proposal that essentially repeats the failed model of militarized security which has permitted the commission of grave human rights violations at the hands of the armed forces."