BEIJING (Reuters) - China's defence ministry expressed anger on Wednesday after the U.S. House of Representatives agreed to authorise the sale to Taiwan of four second-hand U.S. warships, saying the United States had ignored Chinese protests.

China and Taiwan have been ruled separately since defeated Nationalist forces fled to the island at the end of a civil war with the communists in 1949. China has never renounced the use of force to bring Taiwan under its control.

The U.S. legislation also reaffirmed the Taiwan Relations Act, which obligates the United States to come to Taiwan's aid in the event of an attack, and was enacted in 1979 when Washington severed formal ties with the island in favour of recognising the People's Republic of China in Beijing.

China's defence ministry said it was resolutely opposed to all arms sales to Taiwan, saying it was an interference in China's internal affairs.

"The U.S. side ignored China's strong opposition, and insisted on passing the bill pushing weapons sales to Taiwan," the ministry said in a statement on its website (www.mod.gov.cn).

"This act is highly damaging, and doubtless will seriously interfere in and damage the development of Sino-U.S. military ties and the peaceful development of cross-strait relations."

The Taiwan issue concerns China's territorial integrity and core interests, the ministry added.

"China demands that the U.S. side fully recognise the high sensitivity and serious harm of this bill, earnestly respect China's core interests and important concerns ... and stop selling weapons to Taiwan."

The statement comes as U.S. Defense Secretary Chuck Hagel is visiting Beijing, where he heard tough words about America's position in bitter territorial disputes between China and regional U.S. allies.

The legislation to sell the warships will have to pass the U.S. Senate before it can be signed into law.

U.S. weapons sales in recent years to Taiwan have attracted strong condemnation in China, but have not caused lasting damage to Beijing's relations with either Washington or Taipei.

While Taiwan and China have signed a series of landmark trade and economic agreements since 2008, political and military suspicions are still deep, especially in democratic Taiwan where many fear China's true intentions.

(Reporting by Ben Blanchard and Michael Martina; Editing by Michael Perry)