NEW YORK - US President-elect Donald Trump and Prime Minister Nawaz Sharif appear to have hit it off rather well in their first phone conversation - promising to build a "strong working relationship" between their two countries and at a personal level.

Pakistan said Donald Trump praised its prime minister as a "terrific guy" and offered support for a "fantastic" country, in the effusive phone call that baffled many after sharp criticisms in the past.

The conversation between the two leaders was "productive," according to a readout released by the Trump transition team late Wednesday evening.

"President-elect Trump also noted that he is looking forward to a lasting and strong personal relationship with Prime Minister Sharif,” it added.

The Trump transition team's readout was couched in diplomatic language in sharp contrast with the ebullient account given in Islamabad.

The news from Islamabad about the phone conversation between Trump and Nawaz Sharif hit the headlines, especially because the President-elect views about Pakistan contrasted with those he expressed on the campaign trail, as commentators reacting with disbelief over the shift in his position.

On Jan 17 Trump wrote: “Get it straight: Pakistan is not our friend. We’ve given them billions and billions of dollars, and what did we get? Betrayal and disrespect — and much worse. #TimeToGetTough” Trump has also proposed restricting the entrance of Muslims to the United States, in particular from countries that are hotspots for what he calls “radical Islamic terror.” That list of countries would certainly include Pakistan.

Pakistanis have also been suspicious of Trump’s relationship with arch-rival India.

Pakistan heavily relies on US aid and is likely to get around $1 billion in economic and security assistance in the 2017 financial year.

Relations plummeted after it emerged in 2011 that the US had carried out a raid to kill Al-Qaeda leader Osama bin Laden, found hiding in Pakistan, without Islamabad's consent.

Trump's election has met with concern over what it could mean for aid commitments and bumpy diplomatic relations.

However, the government statement said Trump urged Sharif to call him "any time even before 20th January" when he takes power.

Trump also responded to an invitation to visit Pakistan by saying he would "love to come to a fantastic country, fantastic place of fantastic people", it said.

He would be the first US president to visit since George W Bush during military leader Pervez Musharraf's rule in 2006. "His visit to Pakistan would be most welcome," a foreign ministry spokesman said Thursday. Pakistan "would like to strengthen ... the existing relationship further and we would like to continue working with the new administration when it takes over," he continued.

Some social media users appeared to welcome the phone call revelations.

"Fantastic diplomacy" wrote Pakistani journalist Waseem Abbasi, based in Washington, on Facebook.

Some were more sceptical.

"But Mr Trump do you know most Pakistanis are Muslim - how can they be 'brilliant and exceptional' as well? Won't you stop them entering?" wrote journalist Omar Quraishi on Twitter.

"I'm still trying to process that zany Trump-Sharif phone call. Who would have known that Trump would become a spokesman for #PakPositive?" tweeted Michael Kugelman, an analyst at the Woodrow Wilson Center in Washington.

Kugelman later warned not to read too much into the call, given how "unpredictable" Trump can be.

Reuters adds: Few details are known about Trump's planned policy for South Asia but the warm words between the leaders suggests ties could be reset under Trump's presidency and will ease concerns in Islamabad that Trump's anti-Muslim rhetoric in the run-up to the poll will not lead to unfriendly policies towards Pakistan.