China and Sao Tome and Principe have officially resumed diplomatic relations after the African island nation abruptly broke away from Beijing's rival, Taiwan.
Representatives from both sides, including Chinese Foreign Minister Wang Yi, signed books at a ceremony in front of their flags in Beijing on Monday.
The move is a victory for China, which considers the self-governing island of Taiwan a part of its territory. Most of the world does not formally recognize Taiwan as a condition of maintaining relations with China.
Beijing and Taipei have competed for allies for much of the nearly seven decades since the end of China's civil war in 1949, when the defeated Nationalist government fled across the Taiwan Strait.
Sao Tome and Taiwan broke ties last week.