The president granted the pardon after Mr Ramanayake apologised to the courts.
An outspoken Sri Lankan politician imprisoned last year for accusing the island nation's judges of corruption was released Friday after a presidential pardon.
Ranjan Ramanayake, 59, was serving as a deputy minister in 2017 when he told reporters that most of the judiciary were dishonest and "work for money".
He was convicted of contempt of court and jailed for four years in January 2021 but walked free after a reprieve from President Ranil Wickremesinghe.
"I will continue my campaign against corruption," Mr Ramanayake told a press pack outside the prison in the capital Colombo. "I want to contest elections and work for my people."
The president granted the pardon after Mr Ramanayake apologised to courts, a government official said.
Mr Ramanayake had claimed he was targeted for speaking out against corruption. He was also arrested in 2020 and charged for allegedly recording more than 100,000 personal phone calls.
The sometimes lewd and compromising contents were leaked on social media, causing a major scandal.
In some of the tapes, Mr Ramanayake is heard discussing court cases with judges, police, politicians and local celebrities.
Police seized hard drives from his home and announced a probe into whether the recordings had been used for blackmail or other criminal activity. The investigation remains open.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)