Despite seven years of sustained efforts and spending billions of dollars and hundreds of its soldiers dead, the Obama administration still finds Afghanistan a dangerous country.

"At this point it's clear that it's a very difficult situation in Afghanistan. It's a dangerous country," White House Press Secretary Josh Earnest said.

He observed that the Afghan government and the Afghan national security forces have been in charge of the security situation in country for only about a year or so.

There are lessons that the Afghans had to learn and some losses that they have sustained. But the US military and North Atlantic Treaty Organization (NATO) partners have made substantial contributions to offering training and advice, and assistance and expertise to those security forces, Earnest said.

"There's also been a mission that US military personnel have undertaken, focused on counterterrorism, that has both an element of protecting the forces serving in Afghanistan, but also protecting the United States and our interests from extremist organisations operating in that region of the world," he said.

Earnest said the president is certainly pleased with the performance of the US military and NATO partners.

"We've actually seen from the Afghans a willingness to fight for their country, a willingness to respond to losses and to recover from them and fight back," he said.

The US, he noted, would continue to have intensive conversations with its NATO partners about how they can contribute to the ongoing efforts inside of Afghanistan.

"I would say that over past 15 years we've seen countries in NATO make substantial contributions to the situation in Afghanistan, and they're going to need to sustain those kinds of contributions moving forward," he said.

"And I'm confident that will be an important part of the discussions over the course of this year, leading up to the NATO summit that's planned for later this summer," Earnest said.