WASHINGTON — President-elect Donald J. Trump inherited a complicated world when he won the election last month. And that was before a series of freewheeling phone calls with foreign leaders that has unnerved diplomats at home and abroad.
In the calls, he voiced admiration for one of the world’s most durable despots, the president of Kazakhstan, and said he hoped to visit a country, Pakistan, that President Obama has steered clear of during nearly eight years in office.
Mr. Trump told the British prime minister, Theresa May, “If you travel to the U.S., you should let me know,” an offhand invitation that came only after he spoke to nine other leaders. He later compounded it by saying on Twitter that Britain should name the anti-immigrant leader Nigel Farage its ambassador to Washington, a startling break with diplomatic protocol.
Mr. Trump’s unfiltered exchanges have drawn international attention since the election, most notably when he met Prime Minister Shinzo Abe of Japan with only one other American in the room, his daughter Ivanka Trump — dispensing with the usual practice of using State Department-approved talking points.
“President Obama benefited enormously from the advice and expertise that’s been shared by those who serve at the State Department,” Mr. Earnest said. “I’m confident that as President-elect Trump takes office, those same State Department employees will stand ready to offer him advice as he conducts the business of the United States overseas.”
“Hopefully he’ll take it,” he added.
A spokesman for the State Department, John Kirby, said the department was “helping facilitate and support calls as requested.” But he declined to give details, and it was not clear to what extent Mr. Trump was availing himself of the nation’s diplomats.
Mr. Trump’s conversation with Prime Minister Nawaz Sharif of Pakistan has generated the most angst, because, as Mr. Earnest put it, the relationship between Mr. Sharif’s country and the United States is “quite complicated,” with disputes over issues ranging from counterterrorism to nuclear proliferation.
In a remarkably candid readout of the phone call, the Pakistani government said Mr. Trump had told Mr. Sharif that he was “a terrific guy” who made him feel as though “I’m talking to a person I have known for long.” He described Pakistanis as “one of the most intelligent people.” When Mr. Sharif invited him to visit Pakistan, the president-elect replied that he would “love to come to a fantastic country, fantastic place of fantastic people.”
The Trump transition office, in its more circumspect readout, said only that Mr. Trump and Mr. Sharif “had a productive conversation about how the United States and Pakistan will have a strong working relationship in the future.” It did not confirm or deny the Pakistani account of Mr. Trump’s remarks.
The breezy tone of the readout left diplomats in Washington slack-jawed, with some initially assuming it was a parody. In particular, they zeroed in on Mr. Trump’s offer to Mr. Sharif “to play any role you want me to play to address and find solutions to the country’s problems.”
That was interpreted by some in India as an offer by the United States to mediate Pakistan’s border dispute with India in Kashmir, something that the Pakistanis have long sought and that India has long resisted.
“By taking such a cavalier attitude to these calls, he’s encouraging people not to take him seriously,” said Daniel F. Feldman, a former special representative to Afghanistan and Pakistan. “He’s made himself not only a bull in a china shop, but a bull in a nuclear china shop.”
Husain Haqqani, a former Pakistani ambassador to Washington, said his government’s decision to release a rough transcript of Mr. Trump’s remarks was a breach of protocol that demonstrated how easily Pakistani leaders misread signals from their American counterparts.
“Pakistan is one country where knowing history and details matters most,” Mr. Haqqani said, “and where the U.S. cannot afford to give wrong signals, given the history of misunderstandings.”
At one level, Mr. Trump’s warm sentiments were surprising, given that during the campaign, he called for temporarily barring Muslims from entering the United States to avoid importing would-be terrorists.
His conversation with Mr. Sharif also came a day after an attack at Ohio State University in which a Somali-born student, Abdul Razak Ali Artan, rammed a car into a group of pedestrians and slashed several people with a knife before being shot and killed by the police. Law enforcement officials said Mr. Artan, whom the Islamic State has claimed as a “soldier,” had lived in Pakistan for seven years before coming to the United States in 2014.
Mr. Obama never visited Pakistan as president, even though he had a circle of Pakistani friends in college and spoke fondly of the country. The White House weighed a visit at various times but always decided against it, according to officials, because of security concerns or because it would be perceived as rewarding Pakistani leaders for what many American officials said was their lack of help in fighting terrorism.
“It sends a powerful message to the people of a country when the president of the United States goes to visit,” Mr. Earnest said. “That’s true whether it’s some of our closest allies, or that’s also true if it’s a country like Pakistan, with whom our relationship is somewhat more complicated.”
Mr. Trump’s call with President Nursultan A. Nazarbayev of Kazakhstan raised similar questions.
Mr. Nazarbayev has ruled his country with an iron hand since 1989, first as head of the Communist Party and later as president after Kazakhstan won its independence from the Soviet Union. In April 2015, he won a fifth term, winning 97.7 percent of the vote and raising suspicions of fraud.
The Kazakh government, in its account of Mr. Trump’s conversation, said he had lavished praise on the president for his leadership of the country over the last 25 years. “D. Trump stressed that under the leadership of Nursultan Nazarbayev, our country over the years of independence had achieved fantastic success that can be called a ‘miracle,’” it said.
The statement went on to say that Mr. Trump had shown solidarity with the Kazakh government over its decision to voluntarily surrender the nuclear arsenal it inherited from the Soviets. “There is no more important issue than the nuclear disarmament and nonproliferation, which must be addressed in a global context,” it quoted Mr. Trump as saying.
Mr. Trump’s statement said that Mr. Nazarbayev had congratulated him on his victory, and that Mr. Trump had reciprocated by congratulating him on the 25th anniversary of his country. Beyond that, it said only that the two leaders had “addressed the importance of strengthening regional partnerships.”