This story was updated on July 22 at 2:25 pm
Ayaz Gul in Islamabad contributed to this report.
WHITE HOUSE - The United States and Pakistan are jointly seeking a way to end the war in Afghanistan, U.S. President Donald Trump said alongside Pakistani Prime Imran Khan in the Oval Office on Monday.
“We’re working with Pakistan and others on getting an agreement signed” with the Taliban while the United States continues to “very slowly and very safely” reduce the number of its troops in Afghanistan, said Trump during his initial meeting with Khan at the White House.
The Pakistani prime minister declared “this is the closest we’ve been to a peace deal in Afghanistan. There’s no military solution in Afghanistan.”
In the coming days, Khan added, there are hopes of getting “the Taliban to speak to the Afghan government.”
Khan complimented Trump for his efforts, saying “he has forced people to end the war, to have a settlement” adding Pakistan has an important role to play as it shares a 2,400-kilometer border with Afghanistan.
“We desperately want peace,” declared Khan.
Trump, during his White House discussion with Khan, declared that if he wanted to win the war in Afghanistan "I could win it in a week. I just don't want to kill 10 million people."
The president warned that Afghanistan “would be wiped off the face of the Earth. It would be gone. It would be over, literally in 10 days. I don’t want to go that route.”
Trump explained that the United States is not supposed to the world's policeman. "We’ve been there (Afghanistan) for 19 years. It’s ridiculous,” he said.
Khan requested the meeting with Trump to stress the need for a political solution to the protracted war in Afghanistan.
Khan had long campaigned against the use of U.S. military force to resolve the conflict even before he came to power after last year’s elections in Pakistan.
Pakistani officials are hoping Khan and Trump will personally bond and help repair the relationship between Islamabad and Washington.
Both Khan, who was a cricket star, and Trump, a real estate developer, are wealthy populists who used their fame to win election to the top political jobs in their respective countries.
Pakistan has arranged Washington’s direct peace negotiations with Taliban insurgents who are fighting local and U.S.-led international troops in neighboring Afghanistan.
The months-long U.S.-Taliban dialogue has brought the two adversaries in the 18-year-old Afghan war close to concluding a peace agreement to pave the ground for ending what has become the longest U.S. foreign military intervention.
The Taliban refuses to engage in peace talks with Afghan interlocutors until it concludes an agreement with Washington that would outline a timetable for withdrawal of all American troops. In exchange, the agreement will bind the insurgents to prevent foreign militants from using Taliban-controlled areas for international terrorism.
The Taliban insists that once the agreement is signed with the U.S. in the presence of international guarantors it will initiate inter-Afghan talks to discuss a ceasefire and issues related to political governance in the country.
Last year, Trump suspended military training programs and canceled hundreds of millions of dollars in security assistance to Pakistan, accusing it of offering “nothing but lies and deceit” while giving safe haven to terrorists staging deadly attacks on the Afghan side of the border.
Islamabad rejected the charges and in turn accused Washington of trying to make Pakistan a scapegoat for U.S. military failures in Afghanistan, plunging bilateral ties to historic lows.
Asked about whether U.S. aid to Pakistan could be restored, Trump said on Monday the country “was not doing anything for us” before Khan became prime minister and was subversive, “going against us.”
Trump also said, previous to Khan, “Pakistan didn’t respect the United States.”
Khan’s three-day official visit to the United States kicked off at a packed sports arena in Washington on Sunday.
“I feel proud that now the whole world is saying Afghanistan has no military solution,” Khan told the cheering crowd.
Organizers the event was the biggest gathering of Pakistani Americans to date.
WATCH: Trump wants to end Afghan war peacefully
Your browser doesn’t support HTML5
In the lead up to Khan’s visit, authorities in Pakistan arrested a radical cleric, Hafiz Saeed, who is wanted by the U.S. for terrorism in India and carries a $10 million reward. Pakistani officials have also taken control of hundreds of Islamic schools, health facilities and offices run by banned organizations blamed for cross-border terrorism.
Saeed's arrest, however, has come under scrutiny because he has previously been detained only to be freed by courts for a lack of evidence linking him to terrorism.
Khan is accompanied on his visit by the Pakistani military chief, General Qamar Javed Bajwa.
The Pakistan army has long been accused of covertly maintaining ties with the Afghan Taliban and terrorist groups like Lashkar-e-Taiba (LeT) founded by Saeed. India accuses LeT of planning and executing the 2008 Mumbai attacks that killed more than 166 people, including foreigners.
Another irritant in Pakistan’s troubled ties with the U.S. is the detention of Shakil Afridi, the jailed Pakistani doctor believed to have assisted the CIA hunt down Osama bin Laden, the mastermind of the September 2001 attacks on America.