President Obama met with NATO Secretary General Jens Stoltenberg in the Oval Office on Monday. (Mark Wilson / Pool/EPA)

President Obama and NATO Secretary General Jens Stoltenberg struck back Monday at Donald Trump’s charge that the security alliance is “obsolete,” too expensive and relatively useless in dealing with today’s terrorism threats.

Obama said after an Oval Office meeting with Stoltenberg that, because of NATO’s strength and partnership, “I’m confident that, despite these choppy waters, we will be able to underscore and underwrite the peace and security and prosperity that has been the hallmark of the transatlantic relationship for so many decades.”

Stoltenberg, who has pressed hard to ensure that European partners spend more on defense, agreed that Europe needed to “invest more in our security when tensions increase.” But, he said in an interview, it is already doing so.

“I’ve been in NATO for 18 months, and I’m impressed at how much NATO allies have been able to deliver” in terms of “increased resources, increased presence and starting on the process of increased defense spending.”

Without specifically mentioning Trump, Stoltenberg vigorously insisted that counterterrorism cooperation was the basis of NATO’s participation in the war in Afghanistan, which he noted was its biggest-ever military operation, launched in response to the Sept. 11, 2001, terrorist attacks against the United States.

A third of all international forces in Afghanistan came from Europe and Canada, Stoltenberg said, and “more than a thousand have lost their lives.”

In statements over the past week, Trump has described NATO as based on a defunct Cold War and as an unfair drain on the U.S. economy.

“It’s possible that we’re going to have to let NATO go,” Trump said in a speech in Wisconsin on Sunday.

While his suggestions that the United States exit NATO, kick some others out or “renegotiate” the terms of membership are far outside the Republican or Democratic mainstream, they follow years of U.S. criticism that Europe has not paid its fair share of the partnership. Although members pledge to spend at least 2 percent of their gross domestic products on defense, only five currently do.

According to NATO figures, the United States, with global responsibilities and reach beyond the alliance, last year spent 3.62 percent of its GDP on defense. Estonia, Greece, Poland and Britain each spent slightly more than 2 percent. Stoltenberg acknowledged that “the picture is mixed” but said it is “better than it was a year ago.” Since NATO’s last summit, in 2014, he said, 16 of the alliance’s 28 members “have increased defense spending in real terms.”

Much of his conversation with Obama, Stoltenberg said, focused on increasing NATO’s role in the fight against the Islamic State. The current U.S.-led coalition of more than 60 countries is only loosely coordinated on issues other than airstrikes in Iraq and Syria.

NATO, he said, could use its existing structures to take over the organization of training for Iraqi and other forces, political consultation, and force generation. NATO last week began training Iraqi officers in Jordan and has training programs in a number of other countries, including Afghanistan.

“I’m in favor of scaling that up,” Stoltenberg said.

Both the United States and Europe, he said, have contributed to a major increase in force and readiness to combat Russian aggression in Eastern Europe.

During Obama’s administration, Stoltenberg said, “he and the United States have delivered” strong leadership and commitment to NATO. Asked what he thought might happen during the next U.S. administration, he said, “I am by nature an optimist.”

“As long as we stand together, as long as we are able to adapt, we will be able to answer and to face new threats.”

Read more: