HONG KONG — China sharply criticized on Friday a decision by Washington to sell four used warships to Taiwan, the self-ruled island it considers part of its territory.

President Obama signed legislation on Thursday approving the sale of four Hazard Perry-class guided-missile frigates, the first military hardware sale to Taiwan since 2011, when the United States transferred upgrades to F-16 fighter jets.

A spokesman for China’s Foreign Affairs Ministry, Qin Gang, said Friday during a regularly scheduled news conference that China “is firmly opposed to the arms sales by the U.S. to Taiwan.” He added that the warship transfer “brutally interferes in China’s domestic affairs and undermines China’s sovereignty and security interests.”

Taiwan’s Defense Ministry indicated this year that it would probably buy only two of the vessels, and Taiwan’s government must still approve the purchase. The frigates were built in the early 1980s and have either been decommissioned or soon will be. A price has not been announced.