President Trump said Monday that he could drop the world’s largest nonnuclear weapons on Afghanistan and end the war there “in a week,” but would not do so because it would kill millions, as he vowed to resolve a nearly 19-year war that makes U.S. troops into “policemen” rather than warriors.

Sitting with visiting Pakistani Prime Minister Imran Khan, Trump praised Pakistan’s effort to foster negotiations with the Taliban, saying the country is now exerting influence over the insurgents that it had held back because the country did not respect previous American leaders.

“I think Pakistan can do a tremendous amount against, with respect to, Afghanistan,” Trump said during a wide-ranging 40-minute question-and-answer session at the White House. “They didn’t do it, and I don’t blame them because they were dealing with the wrong president.”

The U.S. military’s role in Afghanistan has been a continuing sore spot for Trump, who has questioned why American troops remain in the country — part of his broader push to limit U.S. involvement abroad.

In Khan, a populist former cricket star and fellow newcomer to politics, Trump has found a potential partner in resolving the longest U.S. war. Both favor direct talks with the insurgents that sideline the U.S.-backed government in Kabul, and Trump has set aside President Barack Obama’s qualms about negotiating with terrorists.

Trump said talks with the Taliban are going well, and he hinted at an announcement soon that could allow him to reduce the number of U.S. troops in Afghanistan.

“We’ve made a lot of progress over the past couple of weeks, and Pakistan has helped us with that progress,” Trump said.

Khan said a potential deal is closer than ever before, and he echoed Trump’s view that “there is no military solution in Afghanistan.”

But while Trump talked of the progress being made, he also said that he could end the war quickly and that in the process, “Afghanistan would be wiped off the face of the Earth,” adding that he doesn’t like that option because it would be a humanitarian disaster.

“If we wanted to fight a war in Afghanistan and win it, I could win that war in a week,” Trump said. “I just don’t want to kill 10 million people.”

He later clarified that he had plans in reserve to drop enormous bombs on the country in an all-out military onslaught.

“I don’t want to go that route,” he said.

The president also offered to mediate in the decades-long dispute between nuclear-armed Pakistan and India over the Kashmir region. Each country has controlled a piece of the region since Pakistan was created in 1947, and the two nations have fought several wars along a heavily militarized border.

“If I can help, I would love to be a mediator,” said Trump, claiming that Indian Prime Minister Narendra Modi had sought his help. Khan said that Trump would have the blessings of “over a billion people” if he were able to resolve the situation.

But India, which has always been publicly against third-party mediation on Kashmir, issued a swift denial of Trump’s claim.

Raveesh Kumar, the Indian Foreign Ministry spokesman, said that “no such request has been made” on Kashmir.

“It has been India’s consistent position that all outstanding issues with Pakistan are discussed only bilaterally,” he said in a tweet. “Any engagement with Pakistan would require an end to cross border terrorism.”

Trump has an established relationship with Modi and met with him last month, but Monday was his first sit-down with the charismatic and iconoclastic Khan.

Trump predicted a turnaround for a troubled relationship in which U.S. leaders have frequently accused Pakistan of playing a double game that has prolonged the war next door in Afghanistan, endangering U.S. forces.

“Pakistan never lies, but Iran does,” Trump said, as he and Khan shared a smile.

Last year, before Khan was elected, Trump accused Pakistan of “nothing but lies & deceit” and canceled $1.3 billion in annual military aid. That money could be restored, depending on cooperation under new leader Khan, Trump said Monday.

The immediate goal of U.S. and Pakistani involvement is to persuade the Taliban to agree to a cease-fire and eventual direct negotiations with the Kabul government. Trump has named veteran diplomat Zalmay Khalilzad to lead U.S. efforts.

The commander of U.S. forces in Afghanistan, Army Gen. Austin “Scott” Miller, said in an interview with Washington Post columnist David Ignatius that he is focused on preventing Afghanistan from again becoming a sanctuary for terrorists who could strike the United States and its allies.

“The outcome in Afghanistan should be about safeguarding the national interests of the U.S. and our allies,” Miller said.

Khalilzad has led at least eight rounds of U.S. talks with the Taliban.

“We are not cutting and running,” Khalilzad told a Washington audience this month. “We’re not looking for a withdrawal agreement. We’re looking for a peace agreement. And we’re looking for a long-term relationship and partnership with Afghanistan.”

Khan has sought to use Pakistan’s influence in Afghanistan to improve his footing with Trump, and the visit Monday was seen as his reward. The prime minister praised Trump repeatedly in their Oval Office appearance before reporters, and Trump responded with compliments on Khan’s strength and athletic prowess. He said he would like to visit Pakistan and predicted growth in trade between the two countries.

When Trump took office, the Pentagon said there were about 8,400 U.S. troops in Afghanistan.

The administration said in August 2017 that the number was actually about 11,000, after accounting for creative practices the Obama administration used to keep the number down.

Trump reluctantly agreed to raise the number to about 14,000 late that year and has since stewed privately that he was misled about what the increase could accomplish. On Monday, he groused that U.S. soldiers are stuck building gas stations and schools in Afghanistan. “It’s ridiculous,” he said.

Navy Cmdr. Rebecca Rebarich, a Pentagon spokeswoman, said this month that the current 14,000 figure includes about 9,000 troops associated with the Resolute Support Mission, which trains and advises Afghan forces, and an additional 5,000 involved in a counterterrorism mission called Freedom’s Sentinel.

“We have already withdrawn quite a few,” Trump claimed Monday. “We’re doing it very slowly, very safely. And we’re working with Pakistan and with, as you know, we’re negotiating with the Taliban. And we’re doing very well in that regard.”

Michael Kugelman, a South Asia expert at the Wilson Center, said getting the United States out of Afghanistan is “arguably Trump’s biggest goal in South Asia.”

“To get out of Afghanistan, he needs a deal with the Taliban. And Trump sees Pakistan, with its leverage over the Taliban, as a key player that can help get him closer to that goal,” Kugelman said.

Trump was also expected to push for the release of Shakil Afridi, a Pakistani physician who worked with the CIA in 2011 to locate al-Qaeda leader Osama bin Laden, who was hiding in Pakistan.

Afridi assisted the U.S. spy agency in running a hepatitis B vaccine program that helped pinpoint bin Laden’s secret compound in Abbottabad. Afridi was imprisoned shortly after bin Laden was killed by U.S. forces there.

“This is an extremely important issue to the president,” a senior administration official told reporters Friday. “Dr. Afridi is a hero in our country.”

Pakistan has resisted his release, accusing him of being a corrupt physician and a traitor. Khan will face significant political head winds should he bend to Trump’s demands for his release, experts said.

“Khan represents Pakistani hyper-nationalism. In Khan’s narrative, the U.S. was wrong to go into Pakistan to get bin Laden, and Dr. Afridi is a traitor for helping the U.S. in its effort to find Bin Laden,” said Husain Haqqani, a former Pakistani ambassador to the United States. “Releasing Dr. Afridi at President Trump’s urging would run against the sentiment of Pakistani pride and nationalism that Khan and Pakistan’s army have promoted.”

In front of reporters Monday, Khan told Trump that he would soon have “good news” about “hostages,” using Trump’s term. It was not clear whether they were referring to Afridi.

Trump also opened the meeting with a rambling reference to “polio vaccines,” saying he and Khan would discuss a problem with vaccines in Pakistan.

Exposure of the CIA’s role in Afridi’s vaccination campaign led to a backlash in Pakistan against other vaccination efforts, including against polio.

Dan Lamothe in Washington and Niha Masih in New Delhi contributed to this report.