Donald Trump left the opening day of the Nato summit in Brussels in disarray on Wednesday after making a surprise demand for members to raise their defence spending to 4% of GDP, and clashing with German chancellor Angela Merkel over a proposed pipeline deal with Russia.

Trump left the assembled presidents and prime ministers floundering, unsure whether he was serious about the 4% target, double the existing Nato target of 2%, which many do not meet, or whether it was just a ploy.

After making the announcement, Trump walked out.

The White House press secretary, Sarah Sanders, confirmed the 4% figure. “During the president’s remarks today at the Nato summit he suggested that countries not only meet their commitment of 2% of their GDP on defence spending, but that they increase it to 4%,” she said.

Sanders added: “President Trump wants to see our allies share more of the burden and, at a very minimum, meet their already stated obligations.”

The chaotic first day dismayed Nato officials and will please Russian president Vladimir Putin, who has long pursued a strategy of creating division in Nato. Trump is due to meet Putin in Helsinki next week.

Nato leaders are pressing Trump to raise a series of concerns with the Russian leader.

Trump’s demand over defence spending came during a meeting at which leaders discussed “burden-sharing”. The US president’s attention span is notoriously short: he tweeted during the session about soya beans and American farmers.

According to Bulgarian president Rumen Radev, Trump raised the issue of the increase in defence spending and “he just left after he announced that”.

Sanders insisted that Trump had raised the issue at last year’s Nato summit. However, officials from other states said it had come as a surprise.

At the closed session – with no journalists present – Trump also called out the five members that have met the existing 2% defence spending target and 23 that have not.

According to newly published Nato figures, countries that meet or exceed that 2% target are: the US on 3.6%, Greece on 2.2%, Estonia 2.14%, the UK 2.10%, and Poland on 2%. France spends 1.8% and Germany 1.2%.

Before heading off for dinner, Trump tweeted: “What good is Nato if Germany is paying Russia billions of dollars for gas and energy? Why are their only 5 out of 29 countries that have met their commitment? The US is paying for Europe’s protection, then loses billions on Trade. Must pay 2% of GDP IMMEDIATELY, not by 2025.”

At the meeting, Theresa May, who was sitting next to the US president, said: “Of course, more can and should be done in terms of defence spending. Our collective security depends on it.” But UK officials did not back Trump’s calls for an almost doubling of defence spending for the UK.

Trump is to fly from Brussels to the UK on Thursday.

The summit got off to a bad start, confirming the fears of Nato officials, when Trump had a tetchy breakfast meeting with the Nato secretary-general, Jens Stoltenberg. He also said Germany’s new gas pipeline into Russia was inappropriate, and that it had become a captive of Russia due to its dependence on it for energy supplies.

“It should never have been allowed to happen. Germany is totally controlled by Russia because they will be getting60%-70% of their energy from Russia and a new pipeline,” Trump said.

“On top of that, Germany is just paying just a little bit over 1% [of GDP on Nato defence contributions], whereas the United States is paying 4.2% of a much larger GDP. So I think that’s inappropriate also.”

Germany’s plan to increase its defence expenditure to 2% of GDP by 2030 was not good enough, Trump said. “They could do it tomorrow,” he added.

Stoltenberg seemed surprised by the force of Trump’s remarks. He attempted to respond, saying mildly: “Even during the cold war, Nato allies were trading with Russia.”

Merkel, arriving at Nato headquarters a few hours later, pushed back, saying she knew about Russia and authoritarianism, having been brought up in East Germany when it was part of the Soviet Union’s sphere of interest.

Rejecting Trump’s accusation that Germany is under Russian control, she said: “I am very happy that today we are united in freedom, the Federal Republic of Germany. Because of that we can say that we can make our independent policies and make independent decisions. That is very good, especially for people in eastern Germany.”

She hit back at Trump’s criticism that Germany contributed too little to European defence. “Germany does a lot for Nato,” she said.

Merkel and Trump met face-to-face later in the day, insisting to the press that their relationship was good. Among issues discussed was the proposed pipeline.

Trump’s antagonism towards Merkel is partly personal, a reaction both to a senior European standing up to him and to her dislike of him, which she makes no attempt to hide.

But it is also strategic: Trump resents what he believes is Germany saving on defence and using the money for Germany’s export drive, giving it an edge in trade, that he believes is at America’s expense.

Nato summits are normally highly orchestrated affairs, most of it worked out in advance. But Trump has introduced a high level of uncertainty, creating nervousness among other leaders and officials about the final outcome of the summit when it ends on Thursday afternoon.