By Agence France-Presse
But Anwar, a leading member of the People's Justice Party that teamed with former prime minister Mahathir Mohamad to oust scandal-tainted premier Najib Razak, also cautioned that "one election does not a democracy make".
"I always believed in the wisdom of the people and that if we fought hard enough we would eventually prevail," he told Australia's Fairfax Media in an interview, adding that a new "golden era" was afoot.
"At a time when democracy is in retreat around the world, I hope that the people of Malaysia have given some hope to people around the world clamouring for their own freedom."
Anwar was heir-apparent to the premiership until Mahathir sacked him in 1998 and he was subsequently jailed for sodomy and abuse of power.
Now 70, he was imprisoned again in 2015 during Najib's rule -- after making historic gains as the head of the opposition at the 2013 elections.
But in a dramatic turnaround, his party joined forces with his former nemesis to inflict a shock defeat last week on the long-ruling Barisan Nasional coalition, ending its six-decade stranglehold on power.
Mahathir told the Wall Street Journal on Tuesday he would be in power for one to two years, before an expected handover to Anwar, who is due to be released on Wednesday.
Malaysia's king has agreed to pardon him, paving the way for his return to politics.
Anwar said that after working with Mahathir for many years he understands "that he cares deeply about Malaysia and the people of Malaysia".
"A new partnership was essential to overcome the deeply entrenched, corrupt system that was presiding over Malaysia," he said, referring to the Najib government.
"Our litmus test has always been supporting the reform agenda.
"So long as there is sincere commitment to these principles, we have always welcomed new supporters. The animosity which preoccupies some observers is not an issue for me."
'I never lost hope'
Even while in jail, Anwar said he had detected growing outrage among Malaysians against Najib, who has been accused of involvement in plundering billions of dollars from sovereign wealth fund 1MDB.
Najib and the fund deny any wrongdoing.
Anwar said the hardest thing about being in jail was its impact on his family.
"My children were quite young during the earlier period of incarceration and that was a difficult period for them and (his wife, Wan) Azizah," he said.
"It is pure agony to see your own children struggling because of decisions you made. This time (in jail) it is my children's children who I missed deeply.
"But as a family, we were in concert that we cannot expect the people of Malaysia to take a risk for their freedom if we ourselves were not prepared to take those same risks.
"As the days and weeks wore on I never lost hope. In fact, even from within the prison cell I sensed that the outrage against a corrupt regime was increasing by the day."