By Agence France-Presse
Port Dickson, Malaysia
Anwar is expected to easily win the local election on October 13 and re-enter parliament as an MP, just months after being released from jail following his alliance's shock election win.
Prime Minister Mahathir Mohamad, 93, has pledged to step aside within two years to hand power to Anwar, his former nemesis with whom he teamed up to oust scandal-plagued Najib Razak and his long-ruling coalition at the national polls in May.
Following the vote, Anwar, 71, received a royal pardon releasing him from prison where he was serving a sentence for sodomy in a case that his supporters said was politically motivated.
He needs to be elected as an MP to qualify to take over from Mahathir, and earlier this month a lawmaker from his party vacated his seat in the coastal town of Port Dickson to allow Anwar's return to parliament.
On Saturday, hundreds of flag-waving supporters of the ruling Pact of Hope alliance marched to a hall in the town as Anwar and the other candidates formally registered for the poll.
But there was shock when it emerged that one of his six rivals in the election is Mohamad Saiful Bukhari Azlan, a former volunteer in Anwar's office whose accusations of sodomy led to him being jailed in 2015.
The ex-aide is running as an independent candidate.
Ibrahim Suffian, who heads independent polling firm Merdeka Center, told AFP Anwar's "detractors are out to embarrass him in any little way they can".
Sodomy charges were first thrown at Anwar in the 1990s, when he was deputy premier and Mahathir was in his first stint as premier, after the pair had a bitter falling out.
He was jailed for the first time in 1999 for sodomy and corruption.
After years leading a disparate opposition, Anwar forged an unexpected alliance with Mahathir to challenge the long-ruling coalition after Najib became embroiled in a scandal surrounding state fund 1MDB. Najib has been arrested and charged over the controversy since losing power.