“It’s an honour to be with you,” Mr Trump told Mr Putin, who responded: “I’m delighted to meet you personally.”
Both sides listed a wide range of topics discussed, including Russia’s alleged meddling in the US election.
Climate change and trade are set to dominate the two-day G20 meeting.
Violent clashes between protesters and police have taken place in the streets outside the venue, with dozens left injured.
A huge police operation is trying to keep demonstrators – who are protesting against the presence of Mr Trump and Mr Putin, climate change and global wealth inequalities – well away from the summit venue, and water cannon have been deployed.
Earlier, US First Lady Melania Trump was unable to leave her hotel in Hamburg because of the protests.
High-stakes headed in
The meeting put Trump, a man who ran for president pledging to buck US foreign relations conventions and put “America First,” face-to-face with those promises as people — including many Democrats — in the United States urged the President to stand up to Putin, assert American dominance and challenge the Russian leader on 2016 election meddling.
Speaking to reporters at the start of their conference, Trump and Putin remained mostly positive.
“President Putin and I have been discussing various things and I think it is going very well,” Trump said. “We have had some very, very good talks.”
“We are going to have a talk now and obviously that is going to continue,” Trump added. “We look forward to a lot of very positive things happening for Russia, and for the United States and for everybody concerned. And it’s an honor to be with you.”
The words were warm enough, but the body language was restrained as this meeting began. Neither man was smiling much as both said they hoped for positive results from their encounter. Their handshake, when it finally came, was brief and businesslike.
But they clearly had plenty to talk about, as their meeting went on well over the time allocated. Russia sees that alone as a success, proof that Vladimir Putin is a global leader to be reckoned with. No-one here is expecting any big deals though, like lifting sanctions for example.
The Kremlin has stressed all along that its main aim is to establish a “working dialogue” with Donald Trump, and perhaps begin the slow process of restoring relations with the US, which are at their lowest point in many years.
Busy day for G20
Trump’s formal meeting with Putin, a pivotal encounter that will likely color the tone and tenor of US relations with Russia for years, sits atop Trump’s schedule of critical meetings on Friday, including a prolonged sit-down with Mexican President Enrique Pena Nieto.
Trump sat between British Prime Minister Theresa May and German Chancellor Angela during Friday morning’s leader retreat and was seen chatting with the British Prime Minister. Putin was seated next to Pena Nieto. Trump, who flew to Germany from Poland on Thursday afternoon, met with Merkel upon landing and had dinner with Japanese Prime Minister Shinzo Abe and South Korean President Moon Jae-in.
Canadian Prime Minister Justin Trudeau has urged G20 leaders to impress upon Mr Trump that he should act as a role model in addressing climate change.
“We’ll tell him it’s important to take a lead role in tackling climate change and creating good jobs,” he told German tabloid Bild, according to Reuters news agency.
Read more related