Several people were reportedly injured in the clashes in Dhaka's Dhanmandi district.
Violence erupted after 5,000 protesters tried to overrun barbed-wire barricades that police had erected blocks away from the election commission office.
The protesters took to the streets defying a ban that police imposed on any gathering in the area.
Tofayel Ahmed, an opposition spokesman, said:"It's our democratic right to stage such protests. Police can't stop us."
Police detained more than 20 protesters, a security official said.
Nearly 7,000 security forces were deployed around the election commission to enforce the ban and prevent protesters from laying siege to the office.
In recent months, opposition supporters have staged a series of anti-government strikes and street protests in Bangladesh, many of which ended in violent clashes with security forces.
The protest was called by Sheikh Hasina, the opposition leader who has threatened to boycott general elections scheduled for January unless reforms are undertaken.
Hasina's Awami League party and its 13 smaller allies have planned a series of protests this month against Khaleda Zia, the prime minister, to press their demands, including Wednesday's plan to seize the election commission.
Zia's five-year term expires next month and a non-party caretaker government is to take over to hold elections in 90 days.
But the alliance accuses the MA Aziz, the chief election commissioner, of favouring Zia's government.
It also says the commission included fake voters in a recently compiled electoral roll. Aziz and the government have denied the allegations.
The opposition alliance also wants a role in appointing the chief of the caretaker government.
The post usually goes to the immediate past chief justice of the country, but the opposition says he is unacceptable because he was a member of Zia's Bangladesh Nationalist party before being appointed chief justice.