Ibrahim called the protest after what he said were "stolen" polls, won by Prime Minister Najib Razak's ruling coalition.
Ibrahim believes the ruling Barisan Nasional coalition used illegal voters, bogus ballots in the elections to continue its uninterrupted rule for the 56th year.
Najib's Barisan Nasional coalition won 133 of the 222 parliamentary seats on Sunday.
Opposition DAP party won 38 parliamentary seats, Anwar's party PKR has 30 seats and PAS party 21 seats.
It was the coalition's worst result in more than half a century in power.
More From This Section
The BN has vehemently denied the opposition's allegations of cheating and accused Anwar of deliberately choosing a small stadium on the outskirts of the capital Kuala Lumpur for the rally to ensure it would spill onto the streets.
But the three-party opposition alliance - which mounted its strongest-ever challenge to the coalition - has called for a recount.
Up to 40,000 protesters, many dressed in mourning black, gathered at the demonstration to denounce the results, the BBC reported.
Police said a request for permission to hold a rally was required to be given at least 10 days before to police.
But the opposition said the protest was lawful.
The government has insisted that the May 5 polls were free and fair, and say that evidence of fraud should be presented.
However, independent watchdogs have said there were "serious flaws".
Irregularities included questions over campaign spending and the Election Commission's independence from the government coalition.
The watchdogs also cited inequalities in how the constituencies were demarcated.