Merkel, who is campaigning for a fourth term, can ill afford the images of chaos and disharmony that dominated news coverage of the summit. The summit, which starts in earnest on Friday, is a chance for her to polish her diplomatic credentials but would be disastrous if marred by widespread violence.
She met US President Donald Trump for an hour on Thursday evening, but less than an hour later police clashed with anti-capitalist demonstrators near the summit venue, firing water cannons and pepper spray at hundreds of black-clad protesters after they threw bottles.
Nearly 75 police officers were injured throughout the evening, with three requiring treatment in hospital, police said. The pilots of a police helicopter sustained eye injuries when laser pointers were directed at them, police said.
A Reuters eyewitness saw at least one protester with blood on his face being treated.
"Welcome to Hell" was the protesters' greeting for Trump and other world leaders arriving for the two-day meeting.
Merkel has taken a high-risk gamble by choosing to hold the summit in the northern port city of Hamburg, partly to show the world that big protests are tolerated in a healthy democracy.
Before meeting Trump, she struck a consensual tone, holding out hope for agreement on the divisive issue of climate policy and pledging to broker compromises. She promised to represent German and European interests at the summit, but added:
"On the other hand, as hosts we - and I - will do all we can to find compromises."
German Foreign Minister Sigmar Gabriel cited "many commonalities" on foreign policy after a meeting that included Merkel, Trump, US Secretary of State Rex Tillerson, and Trump family members and advisers Jared Kushner and Ivanka Trump.
But he told German broadcaster that "clear differences" on climate change and trade continued to divide the two allies.
Merkel said there were "various options" that could be discussed, noting that nearly all other G20 countries besides the United States stood by the accord.
As the leaders began holding informal meetings, thousands of protesters from around Europe, who say the G20 has failed to solve many of the issues threatening world peace, poured into Hamburg to join the main demonstration.
Police expected around 100,000 protesters in the port city, some 8,000 of whom are deemed by security forces to be ready to commit violence. At least 13,000 protesters joined the main march on Thursday, including around 1,000 black-clad and masked anarchists, police said. Up to 20,000 police officers from across Germany are on hand.
As summit host, Merkel must seek consensus among the G20 leaders not only on the divisive issue of climate policy but also on trade - an area fraught with risk as Trump pursues his 'America First' agenda.
Indonesian finance minister Sri Mulyani Indrawati said Merkel must be careful not to allow acrimony to undermine the summit.
"There is quite a delicate balance that Angela Merkel will have to navigate in a way, because it is not clear that being confrontational won't just create even more of a credibility problem for G20 cooperation," she told Reuters.
Merkel earlier said she was committed to an open international trading system, despite fears of US protectionism under the Trump administration.
"We're united in our will to strengthen multilateral relations at the G20 summit ... We need an open society, especially open trade flows," Merkel said in Berlin.
Later, Merkel met with Turkey's Tayyip Erdogan, who this week sharply criticised the German government's rejection of his plans to address Turkish citizens outside the G20 event.
Trump, who earlier in Poland called again on NATO partners to spend more on defence and said he would confront the threat from North Korea, will also meet with Russian President Vladimir Putin for the first time on the sidelines of the summit.
Their meeting, scheduled for Friday, will be closely watched at a time when mutual ties remain strained by US allegations of Russian election hacking, Syria, Ukraine and a US dispute over Trump associates' links to Moscow.
Ahead of the meeting, Putin threw his weight behind the Paris accord.
"We see the Paris Agreement as a secure basis for long-term climate regulation founded on international law and we want to make a comprehensive contribution to its implementation," he told German business daily Handelsblatt.
(Additional reporting by Thomas Escritt, Roberta Rampton, Noah Barkin, Sabine Siebold, Andrea Shalal, Emma Thomasson; Writing by Paul Carrel; Editing by Richard Balmforth and Jonathan Oatis)