Washington is keen to end its involvement in Afghanistan. (File photo)

US President Donald Trump on Sunday hailed progress in negotiations on an Afghanistan peace deal, saying that talks with both the Taliban and the Afghan government are going well.

"We're having very good discussions with the Taliban. We're having very good discussions with the Afghan government," Trump told reporters in New Jersey.

Expectations are rising for a deal in which the United States would start withdrawing its soldiers from Afghanistan after nearly two decades of war that has ground into a stalemate.

Washington is keen to end its involvement in Afghanistan, where it has spent more than $1 trillion and Trump has said since the start of his presidency that he wants troops out.

In return, the Taliban would commit to various security guarantees, including that the Islamist hardliners who long harbored Al-Qaeda would not allow Afghanistan to become a jihadist safe haven.

A US-Taliban agreement would not by itself bring an end to Afghanistan's war, as the insurgents would still need to make a deal with the Washington-backed government in Kabul.