The leaders of China and Japan finally broke the ice Monday as they held their first official meeting, which was examined more for its style than its substance: starting with an uncomfortable handshake and including more stiffness than smiles.

The closely watched encounter between Chinese President Xi Jinping and Japanese Prime Minister Shinzo Abe — on the sidelines of a regional summit in Beijing and lasting about 25 minutes — was an attempt to rebuild diplomatic and economic ties eroded by military tensions in an island dispute and animosity over wartime history.

But there was no warmth as the two men shook hands before their meeting in the Great Hall of the People, with Xi looking impassive as Abe spoke and then turning to the cameras with no trace of a smile.

The pair had not formally met since Xi and Abe took office in March 2013 and December 2012, respectively.

“I believe this is the first step for both Japan and China to return to our basic focus of mutually beneficial and strategic relations and to improve them,” Abe told reporters after the meeting. “We continue to make behind-the-scenes efforts to begin dialogue between our two nations.”

Xi’s comments seemed more guarded, mixing his wish for stable relations with his hope that Japan “keeps with the path of peaceful development and adopts a prudent military security policy,” the state-run Xinhua News Agency reported.

For China, the meeting with Abe was just one of its many diplomatic engagements at the Asia-Pacific Economic Cooperation (APEC) summit.

Xi plans to hold talks Tuesday with President Obama, whose opening address at the summit stressed Washington’s “shared ­future” with Asia. But Obama also leveled cautious criticism at Beijing’s policies, including its opposition to recent ­pro-democracy demonstrations in Hong Kong.

Obama also met with leaders of 11 nations negotiating a broad free-trade pact with the United States, and he announced a deal between the United States and China that eases short-term visa restrictions for students, tourists and businesses.

Xi’s meeting with Abe, however, underscored the growing importance of China as a regional power.

Tokyo had been eager for the meeting, with aides to Abe saying he genuinely wanted better relations, and Japanese officials going to great lengths afterward to portray it as a success.

A Japanese government spokesman said that the atmosphere of the meeting was “sincere” and that Xi had greeted Abe in a “very gentlemanly way.” As the meeting got underway, Abe told Xi that he had recently seen a Chinese ballet performance, and Xi nodded “in a relaxed manner,” the official said.

But some in China’s Web universe reacted very differently to the images of Xi looking stony-faced, in contrast to images of him smiling as he greeted other regional leaders at the summit.

“A great facial impression for Xi Dada. A ‘like’ for him,” said one, using a common nickname for the Chinese leader that roughly translates as Big Xi or Uncle Xi.

“Xi Dada stood up straight for Chinese people, how confident and grand he is,” another posted. The meeting was also given considerably less airtime on state-run China Central Television than Xi’s meetings with other world leaders on Monday, Web users noted.

The two leaders agreed to work toward creating a maritime emergency management mechanism — a kind of hotline — to avoid conflict in the East China Sea over the disputed islands known to Japan as the Senkaku Islands and to China as the Diaoyu Islands.

Although the meeting may have been more about style than substance, analysts say it will give the green light to lower-level ­officials to start making headway on some of the thorny issues that have been bedeviling relations.

“The meeting is historically meaningful,” said Zhou ­Yong­sheng, a professor at the China Foreign Affairs University. “It’s a start of the reversing of ­the China-Japan relationship, which is a positive sign.”

But Robert Dujarric, head of the Institute of Contemporary Asian Studies at Temple University’s Japan campus, cautioned that the meeting did not constitute a major breakthrough, noting the short amount of time the leaders spent together — even shorter when interpretation is taken into account.

“Neither side made any significant changes to its positions in their joint statement,” Dujarric said. “Xi is host. As such, he almost had to greet Abe. If he had not, that would have been news.”

Aside from the islands dispute, relations have been strained by visits by Abe and members of his government to the Yasukuni Shrine, where 14 people convicted of Class A war crimes are memorialized along with 2 million other Japanese who died in World War II.

There was no public commitment from Abe that he would refrain from visiting the site again, as Beijing had demanded, but there was speculation that he might have made private assurances to that effect before the meeting.

Japan is keen to repair economic ties, with its own economy still struggling to recover from a long era of stagnation.

China, for its part, is eager to use the APEC summit to bolster its claim for leadership of the Asia-Pacific region, analysts said.

“China has always wanted to be the leader of the Asia-Pacific. To achieve this, China needs the endorsement of Japan,” said Zhou Weihong, a professor at Beijing Foreign Studies University. “Japan is the most powerful rival of China in Asia. If China wants its policy to go smoothly in Asia, it needs the cooperation of Japan.”

Xinhua warned Sunday that the ice between the two nations was “too thick to melt in a day or two” but that there was no room for delay in improving ties.

Fifield reported from Tokyo. Xu Jing, Liu Liu and Gu Jinglu contributed to this report.