China's parliament approved a law Monday authorizing an attack to stop rival Taiwan (search) from pursuing formal independence, a day after President Hu Jintao told the Chinese military to be prepared for war.

The ceremonial National People's Congress (search) passed the law despite U.S. appeals for restraint and warnings by Taiwan that it would damage regional stability and tenuous relations between Beijing and Taipei.

Delegates to the NPC burst into applause after the vote, shown live on national television.

"This law ... represents the people's determination not to allow Taiwan to be separated from China by any means or any excuses," said Wu Bangguo (search), China's No. 2 leader and chairman of the parliament.

Taiwan and China split in 1949, but the communist mainland claims the self-ruled island as its territory and has threatened repeatedly to attack if it tries to make its de facto independence permanent.

The law doesn't give details of what specific developments might trigger an attack. It adds no new threats or conditions, but it codifies the measures for authorizing military action.

A leading Taiwanese lawmaker denounced Beijing for ignoring Taiwan's opposition and passing a "savage law."

The law shows that China "feels futile and doesn't know how to deal with Taiwan's democracy and freedom," said Chen Chin-jun, a member of the ruling Democratic Progressive Party.

"We can clearly see that Taiwan and China ... are not one China. They are two Chinas or one country on each side," Chen said in Taipei. "Whatever law they passed, Taiwan has its own sovereignty, government, country and democracy."

Japan warned that the law could dangerously raise regional tensions.

"We are concerned about negative effects of the bill on the peace and stability in the Taiwan Straits and the relationship between the two sides," said Chief Cabinet Secretary Hiroyuki Hosoda.

The measure was approved by a vote of 2,896 to zero, with two abstentions, at the closing session of the NPC's annual session. Approval was assured, because the parliament routinely passes by overwhelming margins all legislation already decided by communist leaders. But the overwhelming vote was clearly meant to symbolize the intensity of Beijing's sentiment on the issue.

The law says: "In the event that the `Taiwan independence' secessionist forces should act under any name or by any means to cause the fact of Taiwan's secession from China, or that major incidents entailing Taiwan's secession from China should occur, or that possibilities for a peaceful reunification should be completely exhausted, the state shall employ nonpeaceful means and other necessary measures to protect China's sovereignty and territorial integrity."

Chinese leaders insist that the law is meant to encourage peaceful unification with Taiwan.

"This is a law advancing peaceful unification between the sides. It is not targeted at the people of Taiwan, nor is it a war bill," said Premier Wen Jiabao at a news conference after the close of the NPC session.

Wen warned outsiders not to get involved: "We do not wish to see foreign interference."

China has spent heavily in recent years to modernize the 2.5-million-member PLA, focusing on adding high-tech weapons to extend its reach and back up threats to attack Taiwan.

"We shall step up preparations for possible military struggle and enhance our capabilities to cope with crises, safeguard peace, prevent wars and win the wars if any," Hu said Sunday, according to the official Xinhua News Agency.

Also Sunday, Hu was named chairman of the government's figurehead Central Military Commission, a symbolic move that capped a generational transfer of power. He already heads a parallel party commission that runs China's military.

Hu, 62, has shown no sign of diverging from former President Jiang Zemin's hardline stance toward Taiwan.

"We must ... always place the task of defending national sovereignty, security and territorial integrity and safeguarding the interests of national development above anything else," Xinhua quoted Hu as telling military delegates to the congress.

Taiwanese President Chen Shui-bian has said the new law "enables China to unilaterally decide Taiwan's future and ignore that Taiwanese have the right to choose a democratic and free lifestyle."

Washington is lobbying against European Union plans to lift a 15-year-old arms embargo against China, arguing that high-tech European weapons might be used against Taiwanese or U.S. forces.