Protesters marching through downtown Toronto set police cars ablaze and smashed store windows in a show of opposition to the G20 leadership summit, as police in riot gear scrambled to contain the violence.

Black-clad anarchists separated from what began as a peaceful procession, fanning out through the core of a city generally known for its civility, and forcing police to rush to keep up.

Police cars were set ablaze in at least two areas, including the city's Bay Street financial district, while protesters on trendy Queen Street smashed storefronts and damaged media trucks.

Late in the afternoon, with a light rain falling, hundreds of protesters faced off with police at the corner of Bay and King streets, an area ringed by the head offices of four of the country's top banks.

Toronto Mayor David Miller condemned the violence, but said it was caused by a small group within the larger protest.

A relatively small group of people ... came clearly with the intent of damaging property and perpetrating violence, Miller said at a news conference. They're criminals that came to Toronto deliberately to break the law.

Anarchist groups, which led the violence, had specifically mentioned banks as targets in the run-up to the G20, and a Royal Bank of Canada branch in Ottawa was firebombed last month by a group saying they would protest at the summit.

PEACEFUL START

The initially peaceful march numbered in the thousands when it began in the early afternoon, organized by labor groups that say G20 economic policies favor the rich.

But tensions escalated after the demonstration moved within blocks of the 10-foot (3-meter) fence that rings the G20 summit site.

Whose streets? Our streets, roared the crowd, while TV images showed protesters pushing against police lines and smashing storefronts.

Police closed off a long stretch of King Street, and used the road to move officers and riot police east and west through the core.

While police maintained firm lines along the summit security fence, they refrained from engaging along many of the city's streets, allowing protesters to move in.

At Spadina Avenue, on the northwest of the secured area, one man sat atop a damaged police cruiser holding a placard bearing a quote by former U.S. President Andrew Jackson. He then climbed into the driver's seat and set off the car's siren as other protesters cheered their approval.

Shortly after, the car was set ablaze.

Anti-G20 groups have been demonstrating in Toronto all week before the summit of rich and emerging economies, which follows a smaller meeting of Group of Eight industrial nations in the Ontario resort town of Huntsville.

Canada has budgeted more than C$1 billion ($970 million) for security for the two summits.

(Reporting by Pav Jordan, additional reporting and writing by Cameron French, additional reporting by Claire Sibboney; Editing by Mario Di Simine)