Chinese President Xi Jinping told the visiting leader of Vietnam's ruling Communist Party on Monday that both countries and parties should "never let anyone interfere" with their progress, state broadcaster CCTV reported.
The bullish message against outside interference came at a time of strained relations between China and the West, especially with the United States over Taiwan, the Ukraine conflict, trade and other issues.
Xi and Nguyen Phu Trong, both unmasked, shook hands and embraced before taking part in a televised welcome ceremony in Beijing's Great Hall of the People - an unusual display of close contact between Xi and another leader, as China persists with strict COVID lockdowns.
Trong's was the first visit by a foreign leader since Xi secured a precedent-breaking third term as General Secretary at the Chinese Communist Party's 20th party congress this month.
"The development of the cause of human progress is a long and tortuous process, and the development of socialist countries faces a very complicated international environment and serious risks and challenges," Xi said, according to CCTV.
"The Chinese and Vietnamese parties should persist in working for the happiness of the people and the progress of mankind, push forward socialist modernization with all their might, and never let anyone interfere with our progress or let any force shake the institutional foundation of our development," Xi added, according to CCTV.
The visit by Trong - who holds more power than either Vietnam's president or prime minister - was a showcase of Communist unity.
Vietnam and China are among the last five communist-ruled states in the world, along with Cuba, Laos and North Korea.
Pakistan's Prime Minister Shehbaz Sharif and German Chancellor Olaf Scholz will also visit China this week.
China is Vietnam's largest trading partner and a key source of imports for its fast-growing economy, including raw materials and machinery for its crucial manufacturing sector.
Though the two neighbours have a long history of mistrust and territorial disputes, including over islands and waters in the South China Sea, their Communist parties remain officially close.
Like Xi, Trong has also stayed on as party chief beyond the usual tenure of one or two terms, cementing his influence in a party traditionally governed by consensus among its politburo and powerful central committee. His last trip abroad was to Cambodia.
(This story has been refiled to fix the spelling of Vietnamese in the headline)
(Reporting by Martin Quin Pollard; additional reporting by Beijing Newsroom; Editing by Andrew Heavens)