WASHINGTON — US President Barack Obama defended NATO Monday as a "lynchpin" of US and European security, responding to Republican candidate Donald Trump's recent assertions that the alliance is obsolete.

"NATO continues to be a lynchpin, a cornerstone" of US and European defense policy, Obama said at the end of an Oval Office meeting with NATO Secretary-General Jens Stoltenberg.

Without naming Trump, Obama stressed the key role NATO plays in many parts of the world, saying it has been an "extraordinary partner" in Afghanistan as well as in western efforts to stabilize Iraq and Libya and deal with the refugee crisis in Europe.

"We continue to be united in supporting Ukraine," he added, referring to the conflict in eastern Ukraine where Kiev and western governments accuse Russia of arming separatist forces and deploying troops.

Trump, the Republican frontrunner, has repeatedly attacked NATO over the past 10 days as an obsolete organization that is disproportionately funded by the United States.

Asked about Trump's comments, Stoltenberg said he did not want to take part in the US election debate but said NATO "is as important as ever both for the United States and Europe."

Asked about the timing of Stoltenberg's visit, White House press secretary Josh Earnest said it had been "on the books long before Mr Trump's ill advised comments."