President Trump and Chinese President Xi Jinping attend at a state dinner at the Great Hall of the People in Beijing on Nov. 9. (Thomas Peter/AP)

Donald Trump projected a bombastic, tough-guy image during a campaign in which he promoted an "America first" foreign policy and vowed to "win" at the negotiating table with foreign rivals. But midway through the longest foreign presidential trip in 25 years, Trump is showing that a little flattery can go a long way with him.

In stops in Japan, South Korea and China, Trump was feted, pampered and celebrated with florid displays of diplomatic pageantry and poetry — choreographed and calculated gestures aimed at stroking the ego of the president, a builder of gilded office towers and resorts who should know a thing or two about the advantages of seducing clientele.

"Magnificent," Trump marveled to Chinese President Xi Jinping after a lavish welcome ceremony featuring a military honor guard and cannon fire at the Great Hall of the People in Beijing on Thursday. Friends from around the world, he added, were calling him.

"They were all watching," Trump said. "Nothing you can see is so beautiful."

One year after Trump's electoral victory, foreign leaders have intuited at least one thing about the mercurial president: For Trump, the personal has both political and policy ramifications. Asian leaders seem to be betting that if they can flatter Trump into a friendship now, they then may be able to profit from — or even exploit — that relationship in the future.

[Japanese leader Shinzo Abe plays the role of Trump’s loyal sidekick]

On his Asia trip, Trump has reciprocated his host's hospitality, not just in warm words but, in some cases, in potentially favorable policy shifts that could pay long-term dividends for the Asian nations.

On Thursday in Beijing, for instance, Trump — who on the campaign trail had accused China of "raping" the U.S. economy and promised to label the country a currency manipulator — declared that he did not fault China for its behavior.

The trade relationship is "very unfair and one-sided," he said, before declaring, "I don't blame China."

"After all, who can blame a country for taking advantage of another country for the benefit of its citizens?" he asked, rhetorically.

Trump instead cast blame on previous U.S. administrations for what Secretary of State Tillerson called "benign neglect" in allowing the trade imbalance to accumulate through bad policies.

"I give China great credit," Trump said.

The rhetorical about-face came after less than 24 hours of lavish praise and attention in the Chinese capital, a "state visit plus" that included a sunset tour of the Forbidden City, a glimpse of the Peking opera and a two-hour dinner on Wednesday. A formal state dinner was set for Thursday night.

In their approach to Trump, the leaders of Japan, South Korea and China may have taken some cues from Trump's first foreign trip last spring — and, in particular, his first stop in Saudi Arabia. The Saudi government treated Trump as though he were a member of its royal family, projecting his image on the Ritz Carlton in Riyadh and flying jets overhead in his honor.

He appeared to leave the country, which was once a campaign trail foil as he criticized the Saudis for their repressive record on women and gay people, with a changed perspective.

Trump withheld public judgment in June when Saudi Arabia led a blockade against Qatar, another U.S. ally. This week, Trump interjected in support of the regime after Crown Prince Mohammed bin Salman was accused of conducting a political purge to arrest dozens of rival Saudi princes and government officials under the guise of an anti-corruption investigation.

On Twitter, Trump wrote he had "great confidence" in Mohammed and his father, the Saudi king.

While long on pageantry and praise, Trump's Asia trip has been short on tangible new deals that will benefit the United States. Tillerson, briefing reporters shortly after Trump presided Thursday over a signing ceremony in Beijing for $250 billion in investments and agreements between the two countries, played down the news as relatively minor.

"The trip so far has been full of pomp and circumstance galore — but while optics are great and personal relationships matter, it is the substantive yield of these visits that determines their enduring value," said Scott Mulhauser, who served as chief of staff at the U.S. Embassy in Beijing during the Obama administration. "Candidate Donald Trump's fiery rhetoric on China, security and trade on the campaign trail appear to be taking a back seat to President Trump's eagerness to please his hosts and audiences abroad."

After joint statements to the media Thursday in China's Great Hall of the People, the two leaders declined to take questions from reporters — another win for Xi, whose authoritarian government has tried to limit media freedoms and free speech.

"Do you still believe China is raping the United States, Mr. President?" one American reporter yelled out as Trump and Xi exited the room. Trump ignored the question.

Christopher K. Johnson, a senior adviser at the Center for Strategic and International Studies, told reporters in advance of Trump's trip that China's "state visit plus" approach was "designed to play to what they believe is the president's susceptibility, I guess you could say, to being sort of wowed by the way China does a state visit, which they do very effectively."

"And they're good at, you know, sort of showing their guests 5,000 years of Chinese history," Johnson said. "There'll be a special banquet, you know, a lot of effort to sort of personalize the visit."

It wasn't just China that played to Trump's ego. In Japan, another country the president once accused of predatory trade practices, Prime Minister Shinzo Abe treated him to a round of golf at the course where the 2020 Summer Olympics tournament will be held. In South Korea, which Trump complained during the campaign had not carried enough weight for its own security, President Moon Jae-in turned over the floor of the National Assembly to Trump for a major address shown in prime time on U.S. cable news stations.

The upshot, in each case, was that Trump stifled his campaign-season contempt toward the northeast Asian allies. He praised their "ancient" cultures and their "warrior" spirits. He emphasized his commitment to the long-standing security alliances he once questioned and — while White House aides emphasized that other administration officials, including U.S. Trade Representative Robert E. Lighthizer and Commerce Secretary Wilbur Ross, continued to press Trump's priorities as they negotiated on trade — the president mostly glossed over his most serious concerns.

In Beijing, Tillerson was pressed by reporters over Trump's coziness with Xi. He said some of Trump's remarks were intended as "a little bit tongue in cheek." But, he added, "there's also a lot of truth to it," noting that the United States has long had a lopsided trade relationship with China in part because of the "benign neglect" of previous U.S. administrations that did not press hard enough to close the gap.

Later, asked whether Trump's language praising Xi was too deferential, Tillerson replied: "I did not detect that at all."

Yet there was no mistaking Trump's satisfaction in the sumptuous welcome he received here. He touted the "great chemistry" between him and Xi, saying he had "incredibly warm" feelings toward the leader.

If the early reports were any indication, China's careful stagecraft was viewed by its leadership as yielding results. The Global Times, a newspaper known for its nationalist rhetoric, declared Thursday that Trump "respects our head of state and has repeatedly praised President Xi Jinping in public."

Emily Rahaula, Amber Ziye Wang and Yang Liu in Beijing contributed to this report.