Chinese President Xi Jinping met with high-level North Korean party officials in Beijing on Wednesday, in a sign that the two sides are trying to bolster their longtime amity amid continued tensions over Pyongyang’s nuclear ambitions.

The rare meeting came a day after Ri Su Yong, the senior North Korean official in the delegation and one of the top lieutenants of leader Kim Jong Un, arrived in Beijing, where he reaffirmed North Korea’s commitment to its nuclear program, the main source of a rift between the socialist allies in recent months.

On Wednesday, Mr. Ri met with Mr. Xi and delivered a short message from Mr. Kim, according to China’s state-run Xinhua News Agency. Xinhua said both sides expressed a mutual determination to strengthen their relationship and protect stability in the region.

A day earlier, Mr. Ri met with Song Tao, a top Chinese Communist Party official, and briefed him on North Korea’s recent ruling party congress, its first in 36 years.

The high-level meetings during the three-day visit, including the audience with Mr. Xi, underscore the efforts both sides are making to improve relations after a rocky six-month period marked by North Korea’s fourth nuclear test in January and a long-range rocket launch in February.