President Donald Trump has paid a surprise Thanksgiving visit to Afghanistan, where he announced the US and Taliban have been engaged in ongoing peace talks.

In his first trip to the site of America’s longest war, President Trump arrived at Bagram Air Field shortly after 8.30pm local time and spent more than two-and-a-half hours on the ground, serving turkey, thanking the troops and sitting down with Afghan President Ashraf Ghani.

Reporters were under strict instructions to keep the trip to a secret to ensure his safety in the country.

Travelling with a small clutch of aides, including his acting chief of staff, press secretary and national security adviser, but not the first lady, President Trump appeared in good spirits as he was escorted around the base by heavily armed soldiers.

His first stop was a dining hall where he plated turkey and sat down for a meal.

During his visit, President Trump said the US and Taliban have been engaged in peace talks and insisted the Taliban want to make a deal after heavy US fire in recent months.

“We’re meeting with them,” he said. “And we’re saying it has to be a ceasefire. And they don’t want to do a ceasefire, but now they do want to do a ceasefire, I believe… and we’ll see what happens.”

President Donald Trump  meets with Afghan President Ashraf Ghani
US President Donald Trump meets with Afghan President Ashraf Ghani (Alex Brandon/AP)

The trip comes after President Trump abruptly broke off peace talks with the Taliban in September, cancelling a secret meeting with Taliban and Afghan leaders at the Camp David presidential retreat after a particularly deadly spate of violence, capped by a bombing in Kabul that killed 12 people, including an American soldier.

That ended a nearly year-long effort by the US to reach a political settlement with the Taliban, the group that protected al-Qaeda extremists in Afghanistan, prompting US military action after the September 11, 2001, terrorist attacks.

US and international forces have been on the ground ever since and about 12,000 US forces remain in Afghanistan.

Mr Trump said he was proceeding with a plan to reduce US troop levels to about 8,600, telling reporters we’re “bringing down the number of troops substantially”.

But he added soldiers will stay in the country “until we have a deal or we have total victory”.

Afghan President Ghani thanked the Americans who have made the “ultimate sacrifice” in Afghanistan and assured the president that Afghan security forces are increasingly leading the fight.

“In the next three months, it’s going to be all Afghanistan!” he said.

Mr Ghani also praised Mr Trump for the October mission that killed Islamic State leader Abu Bakr al-Baghdadi.

The Afghan leader also indicated, like Mr Trump, that the al-Baghdadi mission was even more significant than the 2011 mission targeting al-Qaida founder Osama bin Laden.

“President Trump, people talked a lot about bin Laden, but what you did to eliminate al-Baghdadi, who was an organiser and not a talker, is a much greater accomplishment,” said Ghani, in remarks to US troops before Mr Trump’s departure.