WASHINGTON, Oct. 21 (AFP) -- President Joe Biden on Thursday said the United States would come to the defense of Taiwan if the island were attacked by China, which considers it part of its territory.

"Yes," he responded when asked in a CNN town hall about defending Taiwan. "We have a commitment to that."

Biden's statement was at odds with the long-held US policy known as "strategic ambiguity," where Washington helps build Taiwan's defenses but does not explicitly promise to come to the island's help.

He made a similar pledge in August during an interview with ABC, insisting that the United States would always defend key allies, including Taiwan, despite the withdrawal from Afghanistan in the face of the victorious Taliban.

Biden said the United States made a "sacred commitment" to defend NATO allies in Canada and Europe and it's the "same with Japan, same with South Korea, same with Taiwan."

The White House subsequently told reporters that US policy on Taiwan "has not changed."