North Atlantic Treaty Organisation leaders wanted Trump to publicly support the military alliance that he had called "obsolete" during his campaign.
"Many of these countries owe massive amounts of money from past years", he said, adding that the target they had committed to - two per cent of each country's GDP to be spent on defence - was merely "the bare minimum".
German Chancellor Angela Merkel struck an entirely different note as she unveiled a memorial made up of a section of the Berlin Wall to mark the end of the Cold War.
Secretary-General Jens Stoltenberg said that joining the USA -led anti-IS coalition "will send a strong political message of NATO's commitment to the fight against terrorism and also improve our co-ordination within the coalition".
But in remarks that humiliated other leaders, Trump said that "NATO members must finally contribute their fair share and meet their financial obligations".
Ms Merkel, who stood emotionless during the speech, earlier issued her own challenge to the USA president, saying that member states including Germany had already pledged to work toward the 2 per cent target by 2024 and that outlays on security more generally also count toward the goal.
Trump also failed to endorse NATO's agreement that an attack on one of its member nations signifies an attack on all of them. The US president has been very clear on his commitment to Nato's collective defense clause, but also "on his expectations", he said.
However, in his public comments, Trump did not offer specific assurances on Article 5.
The visit with Tusk and Juncker is a victory of sorts for the European Union, which had worked behind the scenes to secure a first encounter with Trump.
He declined to be drawn into the intelligence-sharing row, which has grown after photos from the crime scene appeared in The New York Times newspaper.
He said Trump had a few days ago signed a USA budget proposal to hike spending on USA forces in Europe by 40 percent, in what Stoltenberg called "the best demonstration of commitment to the alliance". In a written statement, Trump called the alleged leaks "deeply troubling" and said he was asking the Justice Department and other agencies to review the matter.
Donald Tusk, president of the European Council, said the group's leaders "sometimes have very different views" on topics such as climate change and trade, "but our role as the EU is to do everything to maintain the unity of the G-7 on all fronts".
"Some issues remain open, like climate and trade".
Trump then straightens his jacket and has a brief conversation with Lithuanian President Dalia Grybauskaite. He said unity must be found around values like freedom and human rights and dignity.
Leaders of the G7 meet Friday and Saturday, including newcomers Emmanuel Macron of France and Theresa May of Britain in an effort to forge a new dynamic after a year of global political turmoil amid a rise in nationalism.