MPs in Spain have voted to curb the power of judges to pursue foreign human rights cases, after the governing party argued against "useless disputes".
The doctrine of universal jurisdiction may now only be applied in certain cases, for example those involving Spanish citizens.
It was once used to pursue Chilean leader Augusto Pinochet.
When a judge sought arrest warrants for former Chinese leaders this month, Beijing made a diplomatic protest.
One opposition MP, Irene Lozano of the small Progress and Democracy Union, accused the governing Popular Party of giving in to Chinese pressure.
Amnesty International and other human rights groups condemned the move as a "step backwards in the fight against impunity for crimes under international law, for justice and human rights".
The amendment to the judicial power act was passed by 180 votes to 137 in the parliament in Madrid, where Prime Minister Mariano Rajoy's party has an overall majority.
Party spokesman Alfonso Alonso said the amendment was needed to avoid "useless disputes that only generate diplomatic conflicts".
Another Popular Party MP, Jose Miguel Castillo, argued that other states like Germany and Italy imposed similar limitations.
Prosecutions under the doctrine of universal jurisdiction created false expectations, he said.
Enshrined in law in 1985, the doctrine was used to pursue Israeli defence officials and Argentine military officers among others.
Attempts by Judge Baltasar Garzon to extradite Pinochet from the UK for human rights abuses were blocked by the British government but left the former leader confined to house arrest for a year and a half, until he left in 2000.
One of the few successful prosecutions - again by Judge Garzon - ended in former Argentine naval officer Ricardo Miguel Cavallo being jailed for life in 2011 in Spain.
He was convicted of crimes against dissidents in his home country during the so called "Dirty War" of 1976-1983.
Earlier this month, a Spanish judge sought international arrest warrants for former Chinese President Jiang Zemin, former Prime Minister Li Peng and three other top Chinese officials as part of an inquiry into alleged genocide in Tibet.
China, an important trading partner for Spain, said it was "strongly dissatisfied and firmly opposed" the request.