Mr Anwar, 66, and two other members of his party were charged in 2012 with violating newly enacted restrictions on public gatherings as well as a court order banning the rally from the centre of the capital Kuala Lumpur.
But the charges were dismissed after a separate court ruled on Monday that the ban on the gathering was invalid, Mr Anwar's lawyer Ram Karpal said.
Tens of thousands had gathered April 28, 2012 to demand reform of an electoral system that critics say is biased toward the ruling coalition that has controlled Malaysia since independence in 1957.
Azmin Ali, the deputy president of Mr Anwar's People's Justice Party and a co-defendant, called the latest developments a ``moral victory'' for the opposition.
"The rulings show that the authorities have to respect the right of citizens enshrined in the constitution to assemble peacefully,'' he told AFP.
A former deputy prime minister and rising ruling-party star, Mr Anwar was sacked in a 1998 falling-out with his boss, then-premier Mahathir Mohamad, and jailed on sodomy and corruption charges in an episode that rocked Malaysian politics.
The charges were widely panned as politically motivated.
Released from jail in 2004 when the sodomy conviction was overturned, Mr Anwar formed an alliance of opposition parties that has put increasing pressure on the ruling Barisan Nasional coalition in parliamentary polls in 2008 and last year.
Critics said the 2012 assembly charges were an attempt to derail Mr Anwar's political comeback. Conviction would have barred him running for office for five years, although he could run on appeal.
Malaysia's next elections are due by 2018.
Earlier in 2012, Mr Anwar had been acquitted of a fresh charge he sodomised a former aide, which he also denounced as a smear.
Sodomy is illegal in Muslim-majority Malaysia.
The government has appealed the sodomy acquittal and a decision is still pending.