The spokesperson, who mentioned it at a daily briefing, did not provide any further information about the call made on Monday.
Pakistani media reports said Trump had offered to play any role he could to help Islamabad find solutions to its problems.
Trump also told Sharif that he looked forward to visiting Pakistan and meeting him, according to Samaa, a Pakistani media website.
The account could not be confirmed independently with Trump’s team.
Last month, in an interview to the Hindustan Times, Trump had called the situation between India and Pakistan “very, very hot tinderbox” and offered to “mediate or arbitrate”, if asked to.
India opposes any third party involvement in the bilateral disputes with Pakistan.
Earlier, Trump had been critical of Pakistan for allowing some terrorist groups to operate from its soil and ridiculed President Barack Obama’s administration for not being able to help the jailed doctor who helped the US track down and kill al-Qaida leader Osama bin Laden, who was sheltering in Pakistan.
After Trump’s election, Islamabad’s foreign policy adviser Sartaj Aziz had said that his country was willing to work with him in fighting terrorism.