– #TrumpHasArrived! The Chinese news media broke out the hashtags this week as soon as Air Force One landed in Beijing, delivering both President Donald Trump and an irresistible propaganda opportunity for Chinese President Xi Jinping.

Trump made it easy, flattering Xi at every turn and blaming the massive trade deficit between the U.S. and China on previous U.S. leaders.

Government censors helped control the message, deleting posts about Trump's comments on North Korea.

Here is a look at how Trump's visit played out in the Chinese media.

Applauding Xi

Trump's visit came just weeks after Xi won a second five-year term as China's leader. Wielding vast powers unseen since the days of Mao Zedong and Deng Xiaoping, Xi used the U.S. president's visit as a way to legitimize his authority at home.

A photo, printed Friday on the front page of People's Daily, China's most read state newspaper, appears to show the U.S. president applauding Xi as the Chinese leader basks in the cheers of well-wishers outside the Great Hall of the People in Beijing.

The photo reinforces the view that world leaders see Xi as a great leader and that China is a superpower on par with the United States.

'Descendants of the dragon'

A hallmark of Xi's tenure has been a re-emphasis on traditional Chinese culture, after decades in which the Communist Party sought to bury much of the country's history. Critics say Xi is selective in retelling history and that he is seeking to counter the spread of foreign influences.

A comment by Trump in the Forbidden City gave Xi a chance to promote his nationalist version of history.

Trump asked Xi if it was true that China's history dated back 5,000 years, before adding that "I guess the oldest culture, they say, is Egypt," with 8,000 years of history.

Xi interjected, saying that China had the longest continuous civilization in history. "We have the same black hair and yellow skin that we inherited," Xi said. "We call ourselves descendants of the dragon."

Poking fun at Trump

Trump was warmly received in China's most prominent news outlets, which praised him as a pragmatic leader who, nevertheless, could be friendlier toward China. But in some forums online, the president was mocked, with social media users describing him as goofy, impulsive, clownish and cute.

On WeChat, China's popular messaging app, users circulated posts analyzing the clothes worn by Trump and his wife, Melania. Some users described the president's necktie as "shallow and exaggerated."

A widely shared article delivered a lengthy analysis of Donald Trump's psyche, which suggested that flattery was the trick to winning him over.

Limiting exposure

China's army of censors went into overdrive as interest in Trump surged during his visit.

Censors prevented internet users from commenting on several reports about Trump and Xi. Officials deleted posts that touched on topics the government deems sensitive, including how Trump was able to evade China's firewall and use Twitter.

Perhaps most striking was the removal of at least two items, written by the U.S. Embassy in Beijing and posted to Weibo, a state-controlled microblogging platform.

One deleted post quoted Trump, in a news conference with Prime Minister Shinzo Abe of Japan, saying "the era of strategic patience is over" when it came to dealing with North Korea, an ally of China.

The government also did not broadcast live a joint news conference between Trump and Xi on domestic channels Thursday.