(CNN) US President Donald Trump sent a letter to Pakistani Prime Minister Imran Khan requesting his country's help to end the nearly two-decades long conflict in Afghanistan, just weeks after engaging in a Twitter spat with the Pakistani leader.

The letter, confirmed by the National Security Council and the State Department, requests Khan's "full support for the U.S. effort to advance the Afghan peace process," according to a State Department spokesperson. An NSC spokesperson described the letter in a statement as asking for "full support for the U.S.-led Afghan peace process," but the phrase "U.S.-led" was later removed.

Trump's request follows a month of often harsh presidential language about Pakistan. Trump complained to Fox News in November that Islamabad doesn't do "a damn thing" for the US and charged that its government had helped Osama bin Laden hide. Later that month, he took to Twitter in an extended diatribe, assailing Pakistan for doing "nothing for us."

Denying sanctuary

The NSC and State Department said that in Trump's letter to Khan, which was disclosed by Pakistan, "the President recognizes that Pakistan has the ability to deny the Taliban sanctuary on its territory. The letter also makes clear that Pakistan's assistance with the Afghan peace process is fundamental to building an enduring US-Pakistan partnership."

Read More