The authorities had warned of the threat of attack by far-left groups

Rocks, bottles and sticks have been hurled at riot police, who are using tear gas and batons charges to try to disperse the hundreds of rioters.

However, the violence only involves a small portion of the estimated 30,000 people police say had joined the rally.

They are protesting against next week's G8 summit of leading industrial nations in Heiligendamm, 25km (16 miles) away.

More than 160 groups of anti-globalisation activists, left-wing groups, students and anarchists had been taking part in the march.

Police say that at least 146 officers have been hurt in the fighting.

Masked protesters have broken up paving stones to use as projectiles and overturned and torched several vehicles, spreading a pall of black smoke over the area.

"The police were attacked massively from the violent protesters. They threw bottles, fire crackers, rocks and Molotov cocktails," police spokesman Frank Scheulen told the Associated Press.

Riot police have responded with tear gas and water cannon in an effort to drive them back.

Our correspondent says that although police have been involved in running charges with protesters they are isolated incidents on the fringes of the rally, involving just a fraction of those in attendance.

The majority of demonstrators have already passed through the city centre and are gathered near the harbour to enjoy a pop concert, our correspondent says.

The challenge for the police now is to contain the violence and ensure it does not reach that concert area, she adds.

Organisers at the concert have been making announcements urging people to stay where they are and not venture over to the part of town where the violence is taking place, but, according to our correspondent, many have been leaving to do just that.

Here to stay

The German authorities had warned in advance that there were serious concerns that far-left groups were planning violent attacks.

The authorities said they would react quickly to any trouble and had deployed at least 13,000 police onto the streets.

Some shops had boarded up their windows as a precautionary measure.

Many of the protesters have travelled to Rostock from all over Europe and the majority have made camp by the harbour saying that they will stay put until the G8 summit, which runs from 6-8 June.

The activist have pitched their tents in a large field where the main entrance bears the words: "No police and no neo-Nazis."

"It's very important people all over the world come and protest against the politics of G8, which actually refer to all people of the world, although they are driven from the high elite in the G8 countries," said one protester.

"They actually use citizens of the world and the environment of the world as their playground to achieve more money and power."