HANGZHOU, China — Let’s say you have the president of the United States coming over for a visit. And say the two of you have been going through a rough patch — disagreements over whether you’re hacking his government, bullying his allies or imprisoning activists by the hundreds.

How do you get through that awkward conversation? If you’re the president of China, the answer is a bit of tea.

Late Sunday night, after hours of stilted bilateral meetings in which the U.S. and Chinese officials waded through their usual disagreements and hopes for cooperation, Chinese President Xi Jinping invited President Obama for a midnight stroll. As they ambled through the dark night at a lakeside park — awkwardly making small talk for the handful of news cameras following them — Xi invited Obama to stop at a scenic pagoda and drink some tea.

It was an odd, carefully staged photo-op that, in many ways, reflects a new public relations strategy Chinese officials have pursued ever since Xi took power and speaks to their powerful ambitions as the country moves forward.

Over the past four years, as China has amassed increasing global influence, its officials have tried to shed unflattering impressions of the stereotypical party leaders — an overly cautious, insecure, bureaucratic party man whose meetings with foreign leaders usually consist of reading the same scripted lines from a piece of paper.

But ever since Xi took over, he has used photo-ops to project a polar opposite image of himself — as a casual, endearingly human, confident leader unafraid to take on the outside world.

The Chinese government has carefully staged pictures of Xi eating buns at a Beijing restaurant and holding an umbrella in the rain with his pants rolled up to keep the cuffs dry, like a regular Joe (or Zhou).

But the pictures they’ve staged of him and Obama have played an especially important role.

After decades as a developing nation, China is now eager to flex its muscles and demand respect. So the image of China’s new leader alongside the leader of the free world — side-by-side, on equal footing, both at ease and confident in the potency of his power — is one that Chinese leaders have been eager to project.

That’s how Obama found himself Sunday night at 10:30 p.m. sitting in a park pagoda, atop a lacquered wooden chair, gamely sipping tea.

In a video of that scene shot by White House cameramen, Xi can be overheard making surprisingly inane small talk. Xi asks Obama whether he exercises. He talks about the weather. “I don’t think the weather will be as good tomorrow,” Xi says.

And, of course, Xi talks about the tea.

“This is tea called ‘Longjing’ tea,” says Xi, who then proceeds to give Obama an entire rundown of the tea’s arcane history.

He talks about how the tea comes from a village named Longjing. He tells Obama how Longjing literally means “dragon well,” a reference to local village legend that involves dragon gods and water.

“Very nice,” Obama says politely.

And it’s clear from the video that the most important thing to Xi isn’t the tea or what’s being said.

It is the furious click-clack of camera shutters around the two leaders, capturing this carefully crafted image of the United States and China — the great power of the past century and the rising power of this century to come — sitting side-by-side.

Gu Jinglu in Beijing contributed to this report.