Mexico's Supreme Court has ruled unconstitutional two state anti-corruption laws that outgoing governors passed in apparent attempts to shield themselves from investigation.

Many Mexicans were outraged when the governors of the states of Veracruz and Chihuahua pushed through the laws just months before they are to leave office giving them the power to name anti-corruption prosecutors.

The federal Attorney General's Office appealed the laws, arguing they violated new federal anti-corruption standards. It said the appeals were meant to show "there is no room for tailor-made local laws."

On Monday, the Supreme court agreed, saying neither law could stand.

There have been allegations of corruption in both Veracruz and Chihuahua, and many feared the now struck-down laws would have allowed the governors to control who would investigate them.