The spokesman, Fawad Chaudhry, says Khan received Trump's letter on Monday morning.
Pakistani media outlets, whose reporters met with Khan, quoted him as saying Pakistan would continue its efforts to help peace in Afghanistan.
Trump told Khan the Pakistan relationship was very important to the U.S. and to finding a solution to the Afghanistan conflict, Chaudhry added.
Last month, Trump said in an interview Pakistan doesn't "do a damn thing" for the U.S. despite getting billions of dollars in American aid, and later accused Islamabad in a tweet of harboring al-Qaida leader Osama bin Laden.
At the time, Islamabad said "such baseless rhetoric ... was totally unacceptable." Khan stressed the United States had provided what he described as a minuscule $20 billion in aid to Pakistan.
Last week, Afghan President Ashraf Ghani said he had formed a 12-strong team to negotiate peace with the Taliban, but warned that implementation of any deal would take at least five years.