WASHINGTON — President Trump, who on Twitter last year accused Pakistan’s leaders of “nothing but lies & deceit,” welcomed the country’s prime minister to the White House on Monday in an effort to mend relations and seek help in ending the war in neighboring Afghanistan.
Seated next to Prime Minister Imran Khan in the Oval Office, Mr. Trump gushed about the prospect of improved relations and trade with Pakistan and said he expected that Mr. Khan would help negotiate peace in Afghanistan so United States troops can come home.
“There is tremendous potential between our country and Pakistan,” Mr. Trump said during a 40-minute question-and-answer session with reporters from both countries. “I think Pakistan is going to help us out to extricate ourselves.”
Administration officials believe pressure from Pakistan could push the Taliban into a permanent cease-fire in Afghanistan. Mr. Trump has repeatedly said he wants to withdraw American forces from Afghanistan and end the 18-year war.
“I could win that war in a week. I just don’t want to kill 10 million people,” Mr. Trump said, describing what he said were prepared military plans in Afghanistan. “If I wanted to win that war, Afghanistan would be wiped off the face of the earth. It would be gone in 10 days.”
Mr. Khan — like Mr. Trump a celebrity-turned-leader who once was Pakistan’s star cricket player — agreed quickly that seeking peace in Afghanistan is the better option.
“There is no military solution in Afghanistan,” Mr. Khan said. “If you go all out military, there would be millions and millions of people who would die.”
Mr. Khan arrived in the United States on Sunday, landing at Dulles International Airport in Virginia where a picture of him riding the airport’s people mover with other travelers sparked a minor social media uproar about the lack of pomp and circumstance.
The prime minister received more of an official welcome on Monday at the White House, where Mr. Trump greeted him in front of the West Wing before a bilateral meeting and a working lunch.
Relations between the two countries have been strained for years because of Pakistan’s ties with extremist groups and its lack of cooperation with the United States in the campaign against terrorist organizations since the Sept. 11 attacks.
But Mr. Trump deepened the rift in January 2018. He tweeted that the United States had “foolishly given Pakistan more than 33 billion dollars in aid” and accused Pakistan’s leaders of treating American officials like fools and giving safe haven to terrorists: “No more!”
Three days later, Mr. Trump suspended security aid to Pakistan, shutting down the flow of up to $1.3 billion in aid each year with a demand that Pakistan’s government cut off ties with extremists.
American officials said last week that the president’s meeting with Mr. Khan was an attempt to repair relations between the two countries, though they said the Trump administration remains “cleareyed” about the continuing links between Pakistan and terrorist groups.
A senior administration official had told reporters that Mr. Trump appreciated Mr. Khan’s earlier statements that Pakistan would no longer be a refuge for terrorist groups. But the official said the United States remained concerned given that terrorist organizations — including Jaish-e-Mohammed, Lashkar-e-Taiba and the Haqqani network — continued to operate in Pakistan with the tacit approval of its national intelligence and military agencies.
Pakistan’s continued imprisonment of Shakil Afridi, a Pakistani doctor who reportedly helped the United States confirm the location of Osama bin Laden, also remains a sore spot between the two countries, officials said.
Mr. Trump said on Monday that he planned to press for the release of Dr. Afridi. A tribal court in northwestern Pakistan in 2012 sentenced Dr. Afridi to 33 years in prison after he helped the C.I.A. pin down bin Laden’s location by running a vaccination drive backed by the United States.
Former President Barack Obama’s administration objected strenuously to Pakistan’s treatment of Dr. Afridi, and Trump administration officials last week called upon Pakistan to release the doctor.
Mr. Khan’s visit to the White House was part of his first trip to the United States as prime minister as he attempts to move beyond the diplomatic clashes with Mr. Trump.
A fiery populist leader in Pakistan, Mr. Khan fired back at Mr. Trump’s tweets last year, accusing the United States of decades of failures in Afghanistan. But on Monday, Mr. Khan was far less confrontational, repeatedly praising Mr. Trump for his leadership.
“He has now forced people to end the war, to have a settlement,” Mr. Khan said of Mr. Trump. “This is a critical time.”
Mr. Khan also seemed willing for Mr. Trump to play a role in resolving the 70-year dispute between Pakistan and India over the Kashmir region. Both countries have claimed the disputed region since Pakistan’s creation in 1947.
Mr. Trump said Prime Minister Narendra Modi of India had recently asked him to be a mediator in the conflict.
“If I can help, I would love to be a mediator,” Mr. Trump said.
But his show of respect to Mr. Khan on Monday was intended largely to press Pakistan to do more for the peace process in Afghanistan.
Mr. Trump said he hoped Pakistan could help resolve the war so the United States could curtail its security measures in Afghanistan. He said that if that happened, the United States might restore some of the funding to Pakistan that he cut off last year.
“I think that Pakistan is going to be a very big help,” the president said, adding later: “I think Pakistan will save millions of lives in Afghanistan. As of this moment, they are working very hard.”