ALGIERS, Algeria - Helmeted riot police armed with batons and shields on Saturday pummeled protesters defying a ban on public gatherings in Algeria's capital, injuring 42 people, an opposition leader said.

Algeria has been among the many North African and Middle Eastern countries hit by shows of resistance against their autocratic leaders after a young Tunisian man set himself on fire last month, triggering a wave of protests that led Tunisia's longtime strongman to flee the country.

Protest organizers at the democratic opposition party RCD draped a Tunisian flag next to the Algerian flag on a balcony of party headquarters where the march was to begin.

Riot police, backed by a helicopter and crowd-control trucks, ringed the exit to ensure marchers couldn't leave the building -- and striking those who tried to come out to take part. Outside, some young men waved the national flag and chanted "Assassin Power!"

"I am a prisoner in the party's headquarters," said Said Sadi, a former presidential candidate who leads the Rally for Culture and Democracy party, said through a megaphone from a balcony window.

Demonstrators shouted "Boutef out!" referring to President Abdelaziz Bouteflika -- echoing cries against Tunisian President Zine El Abidine Ben Ali before he fled Jan. 14 to Saudi Arabia amid huge street protests in Tunisia.

Some would-be marchers reportedly scuffled with police along the planned march route in Algiers.

The official APS news agency said seven police officers were hurt, including two with serious injuries. A party spokesman, Mohcine Belabbas, said 42 protesters were taken to hospital for treatment of injuries.

The party's leader in parliament, Atmane Mazouz, was hit in the face with a police baton. Five protesters were also detained by police, only to be released later, APS reported.

Algeria's government in 2002 enacted law banning public gatherings, a move largely targeting Islamic militants involved in a bloody insurgency that erupted in the country a decade earlier.

The regional government for Algiers denied the RCD's request for an authorization to demonstrate, the official news agency said.

Protesters in countries like Algeria have set themselves on fire in apparent attempts to copy Mohammed Bouazizi, a 26-year-old Tunisian whose self-immolation helped inspire the protests that brought down Ben Ali.

Earlier this month, two demonstrators died in unrest over rising food prices, and the government responded by announcing it would cut the cost of sugar and cooking oil. Some self-immolations have been reported in Algeria.

Algeria has had a simmering Islamic movement, and al-Qaida's north African branch was born on the remains of a radical Muslim group that had fought against the military-backed government.