* Terrorism, trade and climate on G20 agenda on Friday
* First meeting between Trump and Putin draws scrutiny
* Host Merkel tries to forge consensus with election looming
* Police fire water cannon at protesters as leaders arrive
By Noah Barkin and Paul Carrel
HAMBURG, July 7 (Reuters) - Leaders from the world's top economies will try to bridge deep differences with U.S. President Donald Trump on climate change and trade on Friday as a Group of 20 summit gets underway in Germany amid the threat of violent protests.
The meeting in the port city of Hamburg comes at a time of tectonic shifts in the global geo-political landscape, with Trump's "America First" policies pushing Europe and China closer together.
Trump will meet Russia's Vladimir Putin for the first time on Friday afternoon, an encounter that will be intensely scrutinised following allegations by U.S. intelligence agencies that Moscow meddled in the U.S. election to help Trump win.
The summit also brings together Trump and Chinese President Xi Jinping at a time when Washington is ratcheting up pressure on Beijing to rein in North Korea after it test-launched an intercontinental ballistic missile and threatening the Chinese with punitive trade measures.
Amid the big egos and intractable conflicts, the host, German Chancellor Angela Merkel, faces the daunting task of steering leaders towards a consensus on trade, climate and migration - all issues that have become more contentious since Trump entered the White House half a year ago.
Facing her own election in two months, Merkel met with Trump for one hour at a hotel in Hamburg on Thursday evening to try to overcome differences that envoys have been unable to settle in weeks of intense talks, including a last minute trip to Washington by the chancellor's top economic adviser.
The two leaders shook hands and smiled for the cameras, showing none of the tension that hung over their first meeting in Washington in March and Trump's first trip to Europe in May, a visit that led the usually cautious Merkel to suggest the United States was no longer a reliable partner.
"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," Indonesian Finance Minister Sri Mulyani Indrawati told Reuters in an interview.
A senior German official involved in the talks said he expected negotiators would be working around the clock to try to break the deadlock before Saturday, the final day of the summit.
On climate, sources told Reuters that U.S. officials were pushing for a mention of fossil fuels as a viable alternative to cleaner energy sources and that the Europeans were resisting. In addition to the United States, Saudi Arabia was proving difficult to get on side.
On trade, the sources said that Washington was backtracking on language condemning protectionism that Trump agreed to at a Group of Seven meeting in Sicily in late May.
Hanging over the trade discussions is a threat by Washington to use a Cold War-era law to restrict steel imports based on national security concerns, a step that would hit the Chinese as well as partners in Europe.
German Foreign Minister Sigmar Gabriel suggested on Thursday that the measures could trigger a transatlantic trade war.
Merkel was born in Hamburg and she chose the city, a trading hub that helped launch the career of the Beatles, to send a message of openness.
The summit is being held only a few hundred metres from one of Germany's most potent symbols of left-wing resistance, a former theatre called the "Rote Flora" which was taken over by anti-capitalist squatters nearly three decades ago.
As leaders arrived on Thursday, riot police fired water cannon at a group of about a thousand black-clad protesters who hurled bottles in a demonstration organisers had dubbed "Welcome to Hell".
Some 20,000 police from all of Germany's 16 states have been deployed on the streets of Hamburg. They will be facing off against up to 100,000 protesters, including an estimated 8,000 who police say are prepared to use violence.
After sessions on terrorism, the global economy and climate on Friday, the leaders will be joined by their spouses for dinner at the Elbphilharmonie, a striking new glass concert hall perched atop an old warehouse building overlooking the Elbe River. (Additional reporting by Thomas Escritt, Andreas Rinke, Roberta Rampton, Joseph Nasr, Sabine Siebold; Editing by Hugh Lawson)