BEIJING — China and Macedonia resumed diplomatic relations on Monday, leaving Beijing's arch-rival Taiwan with just 28 allies around the world and handing its president his first diplomatic setback.

The official Chinese news agency Xinhua reported that Macedonia had formally resumed diplomatic recognition of China after cutting ties with Taiwan.

Earlier, Taiwan formally broke off ties with Macedonia, ending all economic aid to the Balkan country and attributing the switch in allegiance to Chinese bullying.

Xinhua said Macedonia, in a joint communique signed by Foreign Minister Ilinka Mitreva and Chinese counterpart Tang Jiaxuan, acknowledged Beijing's "one China" principle and promised to shun any official relations with Taiwan.

Beijing insists that countries observe its "one China" principle—which states there is only one China in the world and Taiwan is a part of it—if they want diplomatic ties.

"The normalization has once again demonstrated that China's sovereignty and territorial integrity is inalienable," Xinhua quoted Foreign Ministry spokeswoman Zhang Qiyue as saying. "Any attempt and practice to split China will work to no avail."

"Bilateral friendly and cooperative ties will, in a swift way, be fully restored and promoted, and bilateral cooperation in international affairs be further strengthened," she said.

Macedonia announced on June 12 it was restoring diplomatic ties with China, which regards Taiwan as a renegade province which must be reunited with the mainland, by force if necessary.

Taiwan Foreign Ministry spokeswoman Chang Siao-yue formally announced the split with Macedonia on Monday, accusing Beijing of "coercing" Skopje.

"The decision taken by the Government of Macedonia has not only seriously damaged the national interests of (Taiwan) but also interrupted all the ongoing cooperation projects between the two countries," she said.

"This is bound to hamper Macedonia's socio-economic development in the future."

Taiwan won Macedonian recognition in 1999 in a deal which promised more than $1 billion of long-term aid from Taipei.

Soon after that deal, China, one of five permanent members of the United Nations Security Council, vetoed a U.N. plan to extend the mandate of a U.N. peacekeeping force in Macedonia.

Taiwan promised aid of up to $300 million in cash and more than a billion dollars over the long term, but Skopje received only $20 million in direct investment from Taiwan and $150 million in loans and technical assistance.

Skopje is now keen to regain China's support in dealing with a five-month ethnic Albanian insurgency along its border with Kosovo.

Skopje's switch leaves the Vatican as the only state in Europe with which Taiwan has diplomatic relations. Taiwan now has only 28 allies, most of them cash-strapped countries in Africa, Latin America and the Pacific.

The loss of relations with Macedonia marked the first diplomatic setback for the administration of Taiwan President Chen Shui-ban, who took office in May last year in the island's first democratic transfer of power.

Beijing has tried to persuade Taiwan and its Republic of China governments to reunify under the "one country, two systems" formula under which Hong Kong reverted to Chinese rule in 1997, followed by Macau in 1999.

Chen, addressing a U.S. visitor on Monday, made no comment on the break in ties with Macedonia, but was adamant about defending his country's sovereignty, dignity and security.

Chen again rejected Beijing's "one country, two systems" formula, saying the island's political future should be determined by its 23 million people, not leaders in Beijing.

"Over 70 percent of Taiwan people cannot accept the so-called one country, two systems. It means the Republic of China will be annihilated and Taiwan is a local government of the People's Republic of China," Chen said, adding that opinion polls conducted by the Mainland Affairs Council confirmed this view.

Chen's remarks were relayed by his office.