Image copyright Getty Images Image caption There are still 13,000 Nato military personnel in Afghanistan, mostly American

As Donald Trump settles into his new home in the White House, one of the most pressing issues in his in-tray is Afghanistan.

America's longest war isn't something that he has said much about, and - as with so many issues - what he has said is contradictory.

In the past, he has described America's involvement in Afghanistan as a "disaster", and has talked about pulling out US troops.

But when he spoke to Afghan President Ashraf Ghani on 2 December, he reportedly told him that America would not waver in its commitment to Afghanistan.

Then, however, he failed to invite Mr Ghani to his inauguration, deepening worries in Afghanistan that it simply was not a priority for the new president.

Image copyright Getty Images Image caption Afghan President Ashraf Ghani praised the US for its commitment to Afghanistan, during his first official visit to Washington in 2015

The Taliban pitched in earlier this week, calling on President Trump to withdraw American forces from what they described as the "quagmire" of Afghanistan.

"Nothing has been achieved," said the insurgent group, "except the staining of innocent Afghans in their blood, and the destruction of villages and gardens."

The official American assessment of progress is not much more upbeat.

Mr Trump's challenge was summarised with shocking clarity earlier this month by the US watchdog overseeing the reconstruction process in Afghanistan, the special inspector general for Afghanistan, John F Sopko.

Mr Sopko says the US has spent more in real terms in Afghanistan than America spent on the reconstruction of Europe after World War Two, yet only 63% of the country is currently controlled by the Afghan government, opium production is at record highs and corruption is still rife.

"After 15 years," he says, "Afghanistan still cannot support itself financially or functionally.

"Long-term financial assistance is required if the country is to survive."

Lack of resources

Just how vulnerable parts of the country are became very apparent when an Afghan colleague was given rare access to the battle against the Taliban in Helmand a few weeks ago.

Aziz Ahmad Shafee flew into the provincial capital, Lashkargah, with soldiers from the Afghan National Army's 215th Corps.

A convoy of Humvees drove the troops a few kilometres to the outskirts of the city: that is where the front line is now.

Image caption Afghan soldiers told the BBC they lacked even the most basic supplies

The Taliban now control more than 80% of Helmand.

A province, let us not forget, where most of the 456 British military personnel killed in the Afghan conflict lost their lives.

And - despite a complete restructuring of the command of the 215th Corps overseen by American forces - it seems it still is not combat effective.

Afghan troops complain they lack even the most basic supplies.

"For a month we've been saying we are running out of ammunition but we don't get any new supplies," Sgt class 1 Hyatullah told the BBC.

"Our enemy is firing at us, but we don't have enough bullets to take them on."

Clear strategic interest?

His commander urged America's new president not to falter in his commitment to the Afghan government.

"As a soldier of Afghanistan, I ask his excellency Donald Trump to continue the fight here", said Brig Gen Mohammad Wali Ahmadzai, the commander of the 215th Corps in Helmand.

"If he can give us more support, we can wipe the terrorists out."

Most of the foreign troops in Afghanistan were withdrawn at the end of 2014, but when I visited the headquarters of Resolute Support, the Nato mission in Afghanistan, it was busy, with helicopters flying in and out every few minutes.

There are still 13,000 Nato military personnel in Afghanistan, mostly American.

Image copyright AP Image caption Most US military personnel have left Afghanistan - there is little appetite for more losses among the US public

Brig Gen Charlie Cleveland, the spokesman for the Resolute Support mission, believes America still has a clear strategic interest in Afghanistan.

He says the US troops now have two tasks:

training and assisting the Afghan army

targeting terrorist organisations

Resolute Support's work with the Afghan army has, says the brigadier general, been instrumental in ensuring it has managed to hold the ground it does.

'Equilibrium'

"In the winter of 2015-16, the government of Afghanistan changed their strategy," Brig Gen Cleveland tells me.

"They realised they couldn't defend everywhere, and so what they really started focusing their efforts on was the major population centres.

"As we look at the security situation right now, the government controls - secures - really about two-thirds of the population.

"About 10% of the population is controlled by the Taliban, and the remaining difference is really what's contested."

He says while this situation is not ideal, the Afghan army has managed to reverse what was a deteriorating situation in 2015 and establish an "equilibrium" in favour of the government.

Nevertheless, there is much work to be done.

Some 5,000 Afghan military personnel were killed last year, losses both the Afghan government and Resolute Support agree are unsustainable in the long term.

Image copyright Getty Images Image caption Afghan security forces have launched operations against both Taliban and IS militants

And, amid the uncertainty about American policy, other powers have been flexing their muscles in Afghanistan.

Last month, Russia hosted a meeting in Moscow about the country's future, with senior officials from China and Pakistan, and it makes no secret of the fact it has been talking to the Taliban.

So the big question is what will President Trump do?

Two of his key cabinet picks may provide a clue.

President Trump's Defence Secretary, Gen James Mattis, is a former commander of forces here.

He has spoken in the past about the need to urge Pakistan to take further action against the Taliban and the Sunni Islamist militant Haqqani network.

Image copyright AFP Image caption Soviet troops pulled out of Afghanistan in 1988, but Russia is talking to the Taliban

The new president's national security adviser, Lt Gen Michael Flynn, has also talked about the need for Pakistan to take tougher action against Taliban fighters who shelter there.

And President Trump has been very consistent about his desire to take a tougher line against the so-called Islamic State group.

Pulling out of Afghanistan would make that more difficult, given the toe-hold it has established in eastern Afghanistan over the past couple of years.

So it seems unlikely that - in his effort to extricate America from foreign entanglements - President Trump will simply declare that it has no strategic interest in Afghanistan and withdraw his troops.

He and his advisers will certainly not want to be responsible for America's longest war ending in what many people would regard as a clear defeat.