Peruvian President Pedro Pablo Kuczynski has pardoned former leader Alberto Fujimori on health grounds in a move that has prompted angry protests.
Fujimori, 79, who is serving 25 years for human rights abuses and corruption, was moved from prison to hospital because of health problems on Saturday.
Mr Kuczynski denied pardoning him as part of a deal with his party last week to avoid his own impeachment.
Police in the capital Lima clashed with protesters after the news emerged.
Two members of President Kuczynski's party in the Peruvian Congress, Vicente Zeballos and Alberto de Belaunde, resigned in protest at the pardon.
Meanwhile, supporters of the man who led Peru from 1990 to 2000 celebrated outside the city hospital where he was being treated.
He is admired by some Peruvians for combating Maoist rebels but his critics considered him a corrupt dictator.
His son Kenji tweeted video of himself breaking the news of the pardon to his father in his hospital bed and wishing him a Merry Christmas.
On what grounds was he pardoned?
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".
Fujimori was transferred from his cell to a clinic suffering from low blood pressure and an irregular heartbeat, doctors said.
Kenji Fujimori said earlier that his father would probably not go home for several days.
Was a deal done?
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.
Mr Kuczynski denied the claim.
What was Fujimori convicted of?
In 2007, he 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.
Police reportedly fired tear gas at dozens of protesters who turned out on Sunday evening to protest at news of the pardon, 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."
Jose Miguel Vivanco, executive director of Human Rights Watch in the Americas, tweeted: "I regret Fujimori's humanitarian pardon.
"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."
Lamento indulto humanitario a Fujimori.— José Miguel Vivanco (@JMVivancoHRW) December 25, 2017
En lugar de reafirmar que en un estado de derecho no cabe un trato especial a nadie, quedará para siempre la idea que su liberación fue una vulgar negociación política a cambio de la permanencia de @ppkamigo en el poder. pic.twitter.com/ZZ0R9q70gs
What do his family say?
Despite their differences, both Keiko and Kenjo welcomed the pardon.
"On behalf of the Fujimori family, I would like to thank President Pedro Pablo Kuczynski for the noble and magnanimous gesture of giving my father Alberto the humanitarian pardon," Kenjo tweeted.
"Today is a great day for my family and for Fujimorism," his sister said. "Finally my father is free. This will be a Christmas of hope and joy!"