The NATO alliance is "no longer obsolete," US President Donald Trump said Wednesday after talks with NATO Secretary General Jens Stoltenberg. "Our common security is always number one," Trump said, pointing to the long history of the alliance that he dubbed obsolete during last year's presidential campaign, upsetting allies in the 28-member alliance. Trump said he had complained about NATO being obsolete "a long time ago," saying it did not do enough to fight terrorism. Those complaints rattled European allies, who wondered whether it meant a change in the US commitment to Europe's security. The president reversed himself on Wednesday at a joint news conference with Stoltenberg at the White House. "They made a change, and now they do fight terrorism," he said. "I said it was obsolete; it's no longer obsolete." Stoltenberg welcomed the "very strong commitment of the United States to the security of Europe. Stoltenberg said he and Trump had "a productive discussion" about what more NATO can do in the fight against terrorism. Trump said he was committed to NATO allies and would work to address future challenges, including migration and terrorism, calling on the alliance to help in Syria. His comments were the second time he has indicated a reversal to the language he used while campaigning. In January, British Prime Minister Theresa May said Trump had assured her in their meeting at the White House that he was "100 per cent supportive of NATO." But Trump has not changed his stance on defence spending by countries in the alliance, still calling out those countries that are not spending the agreed baseline of 2 per cent of GDP on defence. Stoltenberg thanked Trump for urging members of the alliance to increase their defence spending, saying NATO members are all seeing the effects of Trump's strong stance on the issue. "President Trump's message has been very helpful," he said, noting that defence spending last year increased 3.8 per cent in the alliance as a whole, or by 10 billion dollars, reversing a downward spending trend. Last year five NATO countries met the spending target; next year it will be eight, he added. "We are working to keep up the momentum, Stoltenberg said. Trump met Stoltenberg for the first time at the White House on Wednesday as part of preparations for a NATO leaders' summit in Brussels next month. Trump this week signed off on Montenegro joining the military alliance, bringing the Balkan nation one step closer to becoming NATO's 29th member. The alliance's eastward expansion has further exacerbated tensions with Russia, and Montenegro has accused Russia of involvement in a disrupted plot to overthrow its government. Trump has taken a harsher tone toward Moscow since a chemical weapons attack by Syria last week.