Bangladesh police fired rubber bullets and teargas at a group of opposition party supporters in the capital, Dhaka, on Wednesday as tension soared weeks before a general election.

Activists of the Bangladesh Nationalist Party (BNP) responded to the police action by setting fire to police vans and cars, as well as several motor-bikes, according to police and media.

"Our force was attacked without any reason. They were only trying to ease the traffic flow but suddenly they were targeted," said Masudur Rahman, a spokesman for the Dhaka Metropolitan Police.

The BNP supporters were accompanying an election candidate who was picking up election nomination papers from the party's offices in the city.

Police initially asked the group numbering more than 500 to disperse because they were creating a traffic jam but an altercation ensued and fist-fights broke out between the BNP supporters and police.

The BNP said that at least 12 of its supporters were injured. Police said at least 20 officers were hurt.

BNP Secretary General Mirza Fakhrul Islam Alamgir denounced the police action as an "injustice", and part of a government plot to exclude the party from the Dec. 30 election.

General elections are invariably volatile in Bangladesh where politics has for more than two decades been dominated by rivalry between two women leaders - Sheikh Hasina and Khaleda Zia - both of whom have been prime minister.

Hasina, who is prime minister now, and Khaleda, leader of the BNP, are both related to former national leaders.

The BNP says a caretaker government is essential for free and fair elections as otherwise it says Hasina's ruling Awami League will use the machinery of government to support its campaign.

The BNP is in disarray following the jailing early this year on corruption charges of Khaleda, on what the party says were trumped-up charges to keep her out of politics.

The last election, in 2014, which the BNP boycotted, was marred by deadly violence and criticised by international observers as flawed.

An alliance of opposition parties, including the BNP, said on Sunday it would contest the election despite the Awami League's rejection of its demand for a caretaker government.

Hasina’s government has won global plaudits for letting in hundreds of thousands of Rohingya refugees from Myanmar.

In particular, they have attacked her for what critics regard as the government’s heavy-handed policing of student protests this year and a crackdown on free speech.