Throughout the afternoon and night, police used water cannons as protesters threw bottles and smoke bombs during the anti-capitalist Welcome to Hell march, which began about 2 miles from where the summit will be held.
Firecrackers and bottles were also thrown at riot police who attempted to disperse the crowd as police helicopters circled overhead. The clashes began after police ordered many protesters to remove their masks.
At least 76 officers were hurt, including oner who had a serious eye injury after a firework went off nearby, Hamburg police said. It was unclear whether that figure included two officers whose sight was affected by someone pointing a laser at their helicopter.
They didn't give the number of injured protesters and bystanders, but said one person had been arrested for throwing a bottle.
There were about 8,000 protesters, according to a police estimate, a far cry from the 100,000 expected on the two days of the summit. The protest dissipated around midnight.
"I came here because in general I'm totally against the G20 summit," Nicklas, a 21-year-old student protester, told CNN earlier.
"...It's the root cause or reason for what's going wrong in the world. Wars can be bad but capitalism kills."
Julia Reusing, 27, from Frankfurt, was upset that police disrupted the demonstration.
"If this is all we can do just for showing our opinion and giving a statement -- and if the state forces are just shutting us up ... I mean what kind of state do we live in?" she said about authorities' initial moves to control the protests.
There were also periods of calm during the day, where demonstrators marched through the port city in northern Germany, home to some 1.8 million people.
But after nightfall there were flames in the streets.
As marchers reached the Rote Flora, a building that has been a traditional gathering spot for leftists, a pile of trash was set on fire in the street. Police used a water cannon to put out the blaze, which consumed bicycles, bags of trash, and other items found nearby.
In another area of the city, one car was destroyed by a fire.
Police said the windows of several shops in two districts were smashed.
Protest breaks apart
Earlier, the main body of protesters splintered and one group took over an intersection where a truck with a sound system blared music suitable for a house party.
Police stayed on the fringes, backed by two trucks with water cannons.
Mark Meyer is part of a grass-roots team of 100 or so lawyers who are volunteering to help protesters understand their legal rights if they are detained.
He told CNN that the police "wanted to crash and smash this demo from the beginning" and were looking for any excuse to do so.
He also said the red zone -- the no-go area near the summit -- is not legal and he will protest against it Friday.
G20 discussions to include climate change, migration
The G20, founded in 1999, meets each year. It includes 19 countries and the European Union and accounts for approximately 80% of global GDP. Around two-thirds of the world's population live in a G20 country.
During the two-day meeting, happening in German Chancellor Angela Merkel's birthplace, leaders are expected to discuss climate change, terrorism and migration.
Not every protester's focus was anti-capitalism.
Kurt, a 23-year-old from Western Germany who refused to give his last name, was demonstrating about climate change and called on Merkel's government to do more.
"In the struggle of climate justice, Germany is still missing its target," he said. "And the way the leaders present themselves is a theater now. Merkel can say Trump exited the Paris Agreement but Germany is still missing its target.
"This summit is a theater for the people at home. ... There's so much rotten in the system and there's so much wrong here still — if we don't leave debt for our children we will leave a dead planet for our children. That's not the alternative."
Elena P., 31 and an art therapist, said she was protesting for more freedoms for migration and stopping the flow of the arms trade.
"This is the real story behind all this capitalism," she said. "Merkel says she will protect migrants but at the same time we are selling weapons to the same places and countries who are committing crimes against the people who are seeking refuge in our country and across Europe."