RIO DE JANEIRO, Brazil -- Leaning out from a balcony, Raissa Moitta Melo let loose a stream of expletives as she filmed the chaotic scene playing out in the street below.

In the wobbly, cell-phone images that Melo later posted online, protesters are seen scattering as a formation of Rio de Janeiro police in riot gear approaches, firing what appears to be rubber bullets in the crowd's direction. The camera shakes as several percussion grenades explode with defeating blasts.

"Police corralling demonstrators. No chance of escape," Melo wrote in comments that accompanied the widely shared video, which she posted on her Facebook page. "Surreal. Cowards. Disgusted."

All over this country, anger at police tactics has grown as law enforcement struggle to contain a wave of protests that have been raging since last month. Dozens of police and protesters have been injured in the sometimes violent demonstrations, with charges of excess violence lobbed against both sides.

The nationwide protests, in fact, started with outrage over the violent police response to a small demonstration in the city of Sao Paulo over a 10-cent increase in bus and subway fares. The movement quickly spread to hundreds of cities, becoming the biggest seen here in a generation. The discontent grew to encompass grievances ranging from government corruption and high taxes to poor public schools and hospitals.

The protests have since tapered off, but several tens of thousands of people still attended union-organized marches nationwide on Thursday after a daylong work slowdown.

The Rio march quickly turned nasty, with skirmishes breaking out between police and small groups of demonstrators. Officers fired percussion grenades, pepper spray and other non-lethal weapons at people in densely populated neighbourhoods. Dozens were chased and detained in a square usually known for live music, and local media said police lobbed tear gas canisters into a hospital.

Melo witnessed part of the Thursday protest. She didn't immediately respond to a request from The Associated Press seeking additional comments about her post.

Amnesty International Brazil's executive director Atila Roque, who also witnessed the Thursday skirmishes in Rio's Flamengo neighbourhood, complained about "the erratic and almost irrational way the police acted."

"It's clear that they're out to hit the protesters personally, not just disperse them. They follow them, corral them and make disproportionate and abusive use of tear gas and rubber bullets," said Roque.

Police officials say officers are merely responding to provocations by hooligans who use the protests as cover to attack them and vandalize property. News coverage by Brazil's major television broadcasters have focused mostly on the young men, many with bare torsos and T-shirts wrapped around their heads obscuring their faces. They lob rocks and Molotov cocktails at police, smash storefronts and scrawl graffiti on buildings.

In one protest, a police officer barely escaped lynching by an angry mob that invaded the Rio state legislature building, inflicting hundreds of thousands of dollars' worth of damage.

Demonstrators, however, say they've also come under attack by officers who make no distinction between small groups of vandals and mostly peaceful protesters. Journalists and passers-by say they've also been targeted by police. One cameraman still runs the risk of losing an eye after being hit by a rubber bullet during a protest in Sao Paulo.

Parents and children enjoying a sunny Sunday afternoon in a Rio park on June 16 found themselves engulfed in clouds of tear gas after police pursued demonstrators taking refuge there.

Four days later, hundreds of people leaving a demonstration that drew an estimated 300,000 people in downtown Rio were chased by a half-dozen motorcycle officers detonating percussion grenades. Officers entered open-air cafes where dozens of people had taken refuge, shooting streams of pepper spray.

A day later, in the Amazonian city of Belem, a 51-year-old cleaning woman caught up in a clash between protesters and police died of cardiac arrest after inhaling tear gas.

After a handful of protesters shoved officers barricading Rio's Maracana stadium, where the June 30 final of the Confederations Cup soccer tournament was about to kick off, officers responded with a barrage of percussion grenades and clouds of tear gas so dense that some Brazilian players said they felt its effects on the pitch.

Brazil's police had already had a tainted reputation, with law enforcement-related killings numbering in the hundreds every year just in Rio de Janeiro state.

Officers are commonly accused of shaking down people to boost their meagre salaries and forming armed militias as brutal as the drug trafficking gangs they're supposed to combat. This year marks the 20th anniversary of several massacres carried out by police, including one in which officers opened fire on dozens of street children sleeping around a Rio church, killing six minors and two adults.

Ruy Quintas, an economics professor at Rio's respected Ibmec business school, said such rough police tactics are a legacy of the 1964-1985 dictatorship that ruled Brazil.

"It is a military police force that is trained to use military tactics to protect the state, not citizens," said Quintas. "Their view of the citizenry is a very negative one."

Nine people were killed when police charged into Rio's Nova Holanda slum hunting for those responsible for the death of an officer slain during a violent protest. Another officer was also killed in the action.

Roque of Amnesty International blamed the government for not ordering police officers to moderate their behaviour.

"We're missing a clear message from the command, from governors, from police commanders that they are not going to tolerate that the police behave like vandals," said Roque, whose organization recently published a pamphlet on best policing practices during demonstrations.

Rio Governor Sergio Cabral said Friday that "any excess must be punished," while adding that vandalism should not be seen as "a normal thing" anywhere in Brazil. President Dilma Rousseff has lashed out repeatedly about vandalism, but has not addressed charges of police brutality.

The state agency overseeing security in Rio insisted the police's use of non-lethal weapons adhered to international norms established by the United Nations. In a statement Friday, the State Security Secretariat said officers have been receiving crowd control training since last year.

The agency said police intervened on Thursday to remove an "illegal blockage" in the roadway and guarantee "the constitutional right to come and go" of millions of people. Multiple calls seeking additional comment from the secretariat went unanswered Friday.

Melo said via Facebook that the police's behaviour would push her and others back into the streets.

"Let's go to the streets once again," she wrote, "and we won't stop while there's still this gratuitous violence."