Trump held out the possibility of restoring US aid to Pakistan.
Pakistan Prime Minister Imran Khan arrived at the White House on Monday to meet US President Trump.
This is the first official meeting between the two leaders as Pakistan seeks to leverage support from the Trump administration on steps taken on containing terrorism, a point of contention with the US president often tweeting on Pakistan's support to terror elements on its soil.
While meeting PM Imran, Trump said the US was working with Pakistan to find a way out of the war in Afghanistan. Trump held out the possibility of restoring US aid to Pakistan.
PM Imran Khan told Trump that there was only one solution for Afghanistan and that a peace deal with the Taliban was closer than it had ever been in the past.
"I don't think Pakistan respected the United States in the past," Trump said, adding, "but they are helping us a lot now."
The US president will be hosting PM Imran for a working lunch later in the day.
The Pentagon said Pakistan's army chief, General Qamar Javed Bajwa, will meet later on Monday with the chairman of US Joint Chiefs of Staff General Joseph Dunford.