The White House national security adviser, Jake Sullivan, met on Thursday with China’s leader, Xi Jinping, and held rare talks with a top Chinese military official in a sign that the two countries are communicating at senior levels despite tensions over the South China Sea and Taiwan.

Mr. Sullivan’s meeting with Gen. Zhang Youxia, vice chairman of China’s Central Military Commission, was the first in years between a senior American official and a vice chair of the commission, which oversees China’s armed forces and is chaired by Mr. Xi. In 2018, Jim Mattis, who was the U.S. defense secretary at the time, met with Gen. Xu Qiliang, who held the vice chair position.

The United States has argued that more open communication is necessary to prevent accidents between the two countries’ warplanes and navy ships as they regularly patrol contested areas like the Taiwan Strait and the South China Sea.

“A meeting with Zhang Youxia is very significant, and an indication that China is prepared to meaningfully re-engage with the Department of Defense,” said Drew Thompson, a visiting senior research fellow at the Lee Kuan Yew School of Public Policy at the National University of Singapore. “Beijing views the military-to-military relationship as an important political indicator of the overall relationship, which differs somewhat from the U.S. perspective, which sees it as a more pragmatic channel to reduce risk.”

Mr. Sullivan’s meeting with General Zhang, which was held at the headquarters of China’s People’s Liberation Army, came on the final day of his three-day visit to Beijing to bolster the Biden administration’s bid to manage competition with China.