Riot police in the capital, Kuala Lumpur, fired water cannon and several dozen teargas rounds after protesters demanding electoral reform tried to break through barriers at Merdeka Square, in defiance of a court order.
A police spokesman estimated there were about 25,000 demonstrators at the protest, although some Malaysian news organisations put the numbers as high as 100,000.
"Look at how many of us there are today – this just proves how sick we are of the corruption of this government," said demonstrator Charles Chan, 33.
"The lies and cover-ups have gone on too long. Even if the next government isn't perfect, it will at least be a change – as long as Najib allows Malaysia a clean election."
Opposition leader Anwar Ibrahim, who many hope will win the upcoming election, rallied the enthusiastic crowds as one of Bersih's leaders, Ambiga Sreenevasan, said: "We all want change today."
Baton-wielding police detained dozens of people, with Malaysian media reports saying as many as 100 were arrested.
Video footage by independent news website Malaysiakini showed angry demonstrators overturning a police car that had allegedly hit two people. Several people elsewhere were seen to have fainted, although no serious injuries were immediately reported.
Some commentators believe the violence could force the prime minister, Najib Razak, to delay elections that must be held by next March but which could be called as early as June.
Najib, whose ruling coalition has held power for nearly 55 years, saw his approval rating fall sharply after the last major electoral reform rally by the Bersih ("Clean") movement in July 2011 when police were accused of a heavy-handed response.
The violence on Saturday occurred shortly after a Bersih leader declared the protest a success and asked people to go home. "They [the police] asked the crowd to disperse but did not give enough warning," said Aminah Bakri, 27, with tears streaming down her face from the teargas. "They do not care."
Phil Robertson, Human Rights Watch's deputy Asia director, condemned the police crackdown. He said: "By launching a crackdown on peaceful … protesters on the streets of Kuala Lumpur, the Malaysian government is once again showing its contempt for its people's basic rights and freedoms."
Bersih, an independent movement whose goals are backed by the opposition, has a history of staging influential rallies.
Malaysians have demanded more freedoms and democratic rights in the former British colony, which has an authoritarian streak. But despite the huge demonstration , there was no indication that Najib's National Front coalition would agree to meet their demands.
"If [elections] are not clean, not fair, show the evidence," Najib was quoted as saying by the national news agency, Bernama, on Saturday. "We do not want to be elected through cheating. We are a government chosen by the people. The majority of the people chose us because they know [we] are better [than the opposition]."
Najib has replaced tough security laws – ending indefinite detention without trial – relaxed some media controls, and pushed reforms to the electoral system, which critics have long complained is rigged in the government's favour.
A bipartisan parliamentary committee set up by Najib this month issued 22 proposals for electoral reform, including steps to clean up electoral rolls and equal access to media.
But Bersih has complained it is unclear if the steps will be in place for the next election. The government says it has already met, or is addressing, seven of Bersih's eight main proposals for the election, which will introduce the use of indelible ink to cut down on fraud.
Bersih says the proposals do not meet most of its key demands, including lengthening the campaign period to at least 21 days from the current seven days and allowing international observers at polling stations.
The National Front, which has governed Malaysia since independence from Britain in 1957, suffered its worst performance in 2008 elections, when it lost more than a third of parliament's seats amid public complaints about corruption and racial discrimination.