A political agreement with Taliban would clear the way for most US troops to withdraw from Afghanistan.

Highlights President Trump lauded Pak's help in advancing peace talks in Afghanistan

US wants agreement with Taliban before polls in Afghanistan in September

The pact would clear way for most US troops to withdraw from Afghanistan

President Donald Trump on Monday hailed Pakistan's help in advancing peace talks in Afghanistan, a marked shift in tone as the United States seeks an accord with the Taliban to end almost 18 years of war.

Speaking from the Oval Office alongside Pakistan's Prime Minister Imran Khan, Trump also warned he could end the conflict in a matter of days through force and "Afghanistan would be wiped off the face of the Earth," but preferred dialogue.

Pakistan was the Taliban's chief sponsor when it took power in neighboring Afghanistan during the 1990s.

Its influence over the group, which has waged an insurgency since it was ousted from power by US-led forces in 2001, is seen as key in facilitating a political settlement with the government of President Ashraf Ghani.

"We've made a lot of progress over the last couple of weeks, and Pakistan has helped us with that progress," said Trump.

"A lot of things are happening for the United States, and I think a lot of great things are going to be happening for Pakistan under your leadership," he added as he turned to face Imran Khan, who is on his first official trip to Washington.

The warm words and smiles signaled a clear reversal for the Republican president, who has in the past accused Pakistan of being duplicitous and last year cut $300 million in security aid.

'Don't Want To Kill 10 Million'

The United States is pressing for a political agreement with the Taliban before presidential voting in Afghanistan in late September. This would clear the way for most US troops to withdraw from Afghanistan and bring an end to America's longest war.

But Trump warned: "If we wanted to fight a war in Afghanistan and win it, I could win that war in a week. I just don't want to kill 10 million people."

Trump has in the past accused Pakistan of being duplicitous and last year cut $300 million in aid.

Shamila Chaudhary, a senior fellow at the New America think tank and a former National Security Council official, told AFP that Khan's visit amounted to "a reward for good behavior for following through on the Taliban talks."

Islamabad wants to shore up relations with Washington after years of discord following the discovery of 9/11 architect Bin Laden on Pakistani soil, where he was killed in a US raid in 2011.

The IMF has just approved a $6 billion loan to help right Pakistan's faltering economy, and keeping the US onside is crucial in maintaining the flow of Western assistance, added Raza Rumi, a Pakistan expert at Ithaca College.

The interaction between the two leaders -- both celebrities-turned-politicians -- had been the subject of much speculation.

But according to Chaudhary, the Trump-Khan encounter was in some ways a "formality" because the meetings between the US and Pakistan's powerful army chief, General Qamar Javed Bajwa, who also traveled to Washington, were where the "real substance... will be discussed."

Khan is seen as much closer to the army, which controls the country's foreign policy, than his recent predecessors, and the presence of Bajwa "gives a little more credibility to whatever message the Pakistanis are bringing," said Shuja Nawaz, a South Asia expert at the Atlantic Council.

A readout of the meeting by the White House said Trump hoped to "revive all aspects of the bilateral relationship," including new trade deals and "strong military-to-military ties."

The latter would be welcomed by Pakistan's military, which is keen to access new US military hardware and restart security aid, said the analysts.