Pena Nieto said on his official Twitter account late Tuesday that after the law takes effect Thursday he will pardon Alberto Patishtan Gomez. 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.
Rights groups including Amnesty International have said the case against Patishtan was plagued with irregularities.
Amnesty International said in a Tuesday statement that Patishtan had publicly called for the removal of his community's mayor a month before the official implicated him in the ambush and killings.
Mexican courts refused to overturn Patishtan's conviction and sentence, saying defense attorneys didn't provide sufficient evidence. The Supreme Court refused to hear the case, saying it could be handled by a lower court.
He has been serving a 60-year sentence for charges associated with the ambush, including murder.
Now 43, Patishtan was being held at the National Institute of Neurology, where he was transferred from prison to undergo treatment for a brain tumor, his lawyer, Leonel Rivero, said.
Rivero told The Associated Press on Wednesday that Patishtan was calmly waiting to see if he receives the announced pardon.