Two U.S. warships sailed through the Taiwan Strait over the weekend, Taiwan's defense ministry said Monday, in a move that Beijing said threatened to hinder U.S.-China relations.

The ministry said the ships made the passage on Sunday, sailing from south to north through the waterway that divides the self-governing island from mainland China.

Beijing frequently objects to the movement of foreign military vessels in the strait based on its claim to Taiwan as its own territory, to be annexed by force if necessary.

Taiwan's defense ministry said U.S. ships were free to sail through the Taiwan Strait as part of their "strategic Indo-Pacific tasks." Despite the lack of formal diplomatic ties, the U.S. is a key ally of Taiwan and provider of defensive weapons.

China has been increasingly willing to protest actions by foreign militaries in areas it considers its home waters or sphere of influence. That especially applies to the Taiwan Strait and South China Sea, which China claims almost in its entirety.

Chinese foreign ministry spokesman Geng Shuang said Monday that China has expressed concern to the U.S. about the warships.

The U.S. should handle Taiwan-related issues "prudently" in order to avoid negatively impacting its relationship with China, Geng said, adding that "the Taiwan issue is the most important and sensitive issue in Sino-U.S. relations."

Last week, Beijing complained to France about a French warship traversing the Taiwan Strait, and blamed British naval activity in the South China Sea for a downturn in bilateral relations.

China's defense ministry said the French warship entered its territorial waters, but China's recognition of the boundary between territorial and international waters is often blurred. China has sought to restrict the activities of foreign militaries in its surrounding waters and maintains its own interpretation of the United Nations Convention on the Law of the Sea, which defines the rights and responsibilities of nations sailing the world's oceans.

The Associated Press contributed to this report.