All 26 were freed on bail, and will go on trial on December 27.
However, five leaders of the Hindu Rights Action Force (Hindraf), which organised the rally on November 25, remained in detention under the colonial era Internal Security Act (ISA) that allows indefinite imprisonment without trial.
On Monday, rights groups staged a protest outside the government's National Human Rights Commission, urging the abolition of the ISA.
The men against whom charges have been dropped, were arrested on November 25 when more than 20,000 ethnic Indians demonstrated in the streets in defiance of a government ban.
They were charged with attempted murder for causing a head injury to one policeman - provoking an international outcry.
In the sessions court, cheers broke out when Abdul Gani Patail, the attorney-general, told the judge that he was dropping all charges against five Indians and attempted murder charges against the 26 others.
"I could be very strict but I don't think this is the time to be that strict,'' Patail said. "Freeing them now would be the "best course of action'' in the public and national interest, he said.
"When we exercise the law ... we look at what is fair and just ... and in my judgment this is the fairest thing to do,'' he said.
Pleas to PM
Several ethnic Indian community groups had urged Abdullah Ahmad Badawi, Malaysia's prime minister, to drop the attempted murder charges.
Ethnic Indians make up about eight per cent of Malaysia's 27 million people, and represent an underprivileged minority.
Malay Muslims comprise about 60 per cent of the population, and control the government.
Hindraf is demanding equality and fair treatment for Indians, saying an affirmative action programme that gives preferential treatment to Muslim Malays is tantamount to racial discrimination.
Ethnic Indians also complain their religious rights are being trampled upon.