A statement from President Kuczynski’s office said he had decided to grant a “humanitarian pardon to Mr Alberto Fujimori and seven other people in similar condition”, without naming the others.

Doctors, the statement added, had “determined that Mr Fujimori suffers from a progressive, degenerative and incurable illness and that prison conditions represent a grave risk to his life”.

Kenji Fujimori said earlier that his father would probably not go home for several days.

The conservative Popular Force (FP) party, led by the former president’s daughter Keiko Fujimori, controls Congress and on Thursday tried to impeach President Kuczynski over a corruption scandal.

However, her brother Kenji split the FP vote, allowing the president to stay in power and prompting the accusation that Fujimori’s release had been promised in exchange.

“To save his own skin he [President Kuczynski] cut a deal with Fujimori’s supporters,” said leftist politician Veronika Mendoza, labelling the president’s decision as treason.

In 2007, Fujimori was sentenced to six years in jail for bribery and abuse of power, but two years later was sentenced to another 25 years in prison for human rights abuses committed during his time in office.

He was convicted of authorising killings carried out by death squads.

Protests erupted soon after news of the pardon came to light on Sunday, with many demonstrators waving pictures of victims of the counter-insurgency campaign.

“We believe the pardon was carried out in an illegal manner,” one unnamed protester told Reuters. “The medical report that supposedly sanctioned this was a fraud. The reality is that this sadly was a political agreement between the Fujimorists and the current government.”

“Instead of reaffirming that in a state of law there is no special treatment for anyone, the idea that his liberation was a vulgar political negotiation in exchange for Pedro Pablo Kuczynski maintaining power will remain forever.”