MEXICO CITY (AP) — President Enrique Pena Nieto has pardoned an indigenous teacher who rights groups say has been unjustly imprisoned for 13 years.

Alberto Patishtan Gomez is the first person Pena Nieto has pardoned under a recent change in Mexico's penal code.

Interior Secretary Miguel Angel Osorio Chong announced Thursday that Pena Nieto ordered Patishtan Gomez released from prison immediately.

The teacher was detained in June 2000 and charged with participating in the ambush and killing of seven police officers in the southern state of Chiapas, home to the Zapatista rebel uprising.

The newly approved law published Wednesday allows the president to pardon prisoners "when there are consistent indications of grave human rights violations" against them. The code already allowed some other kinds of limited presidential pardons.