Thousands of anti-capitalist protesters clashed with riot police near the new headquarters of the European Central Bank (ECB) in Frankfurt, hours before the ceremonial opening of the €1.3bn (£934m, $1.4bn) building.

Police cars were set on fire and streets were blocked by stacks of burning tyres and rubbish bins.

Several thousand riot officers pursued what they said was a minority of violence-minded activists as the bulk of protesters conducted themselves peacefully ahead of a rally in the city's main square. Some blocked bridges across the Main River or streets.

The organisers of the protest, a group called Blockupy – named after the Occupy Wall Street movement in 2011 – estimated that about 10,000 demonstrators were at the rally. Thousands came into the German financial capital from other parts of Europe.

Hundreds of officers ringed the ECB headquarters ahead of the inauguration ceremony. Protesters are targeting the ECB because of the bank's role in supervising efforts to restrain spending and reduce debt in financially troubled countries such as Greece.

"Our protest is against the ECB, as a member of the troika, that, despite the fact that it is not democratically elected, hinders the work of the Greek government. We want the austerity politics to end," Ulrich Wilken, one of the organisers, said. "We want a loud but peaceful protest," he told Reuters.

Frankfurt police spokeswoman Claudia Rogalski described the mood of the crowd as aggressive. "We've had stone throwing, burning rubbish bins and seven police cars were damaged, many set on fire," she said.

ECB President Mario Draghi was due to make a speech at the new ECB headquarters at 11am.

The ceremony went ahead as planned, with ECB President Mario Draghi saying the new building for the euro bloc's monetary authority was "a symbol of what Europe can achieve together."

Police said 350 people were detained as officers pursued what they said was a minority of violence-minded activists using the protest as cover. The bulk of demonstrators conducted themselves peacefully, marching in groups, drumming and singing ahead of a rally in the city's main square.

Some 10,000 people gathered on Frankfurt's main square, the Roemerberg.