Mexico's Supreme Court on Thursday struck down a law that had legalized the domestic deployment of the military against drug cartels.

Deploying the military against cartels has been commonplace in the country since 2006, but the situation was only formalized by legislation last year.

However, nine of the 11 justices in Mexico's highest court ruled that the legislation violated the constitution. President Enrique Pena Nieto sent the bill directly to the court for review after signing it in, amid widespread outcry over the law.

The court found that Mexico's Congress lacked the authority to legislate on "domestic security," saying only the executive branch can dispatch troops.

The ruling comes just a day after the team of Mexico's incoming president said withdrawing the military was not viable, as they are more trustworthy and capable than the often-corrupt police force.

Ahead of the ruling, human rights groups had warned the law could lead to further abuses by the military.

Read more: Mexico fighting endless war against cartels

Watch video 06:33 Share Mexico: Trouble in paradise Send Facebook google+ Whatsapp Tumblr linkedin stumble Digg reddit Newsvine Permalink https://p.dw.com/p/30svI Mexico: Trouble in paradise

No alternatives

President-elect Andres Manuel Lopez Obrador has long criticized the domestic military deployment, but is hamstrung by a lack of realistic alternatives. He has proposed creating a national guard uniting elements of the army, navy and federal police, but that would require lengthy constitutional reform.

An estimated 170,000 people have died in drug violence in Mexico and thousands more have gone missing. Last year alone, more than 31,000 people were murdered. The violence is driven by conflict between cartels over supply routes for heroin, cocaine and synthetic drugs to the US.

The incoming president also hopes to cut into the power of cartels by legalizing recreational and medical marijuana.

Meanwhile, notorious drug kingpin Joaquin "El Chapo" Guzman is on trial in the US, having reached the upper echelons of the cartel business before being extradited.

aw/msh (AFP, AP, Reuters)