BEIJING, May 29 (Reuters) - China said on Friday it firmly opposes any attempt ‌by any country to undermine its ‌sovereignty and security "under the pretext of freedom of navigation", ​in response to a Canadian warship passing through the Taiwan Strait.

HMCS Charlottetown conducted a routine transit through the Taiwan Strait on ‌May 22, which ⁠was completed on May 23, Canadian Department of National Defence told ⁠Reuters on Friday.

China claims sovereignty over democratically governed Taiwan and the strategic Taiwan Strait ​despite Taipei's ​rejection of the ​claims.

Chinese foreign ministry spokesperson ‌Mao Ning added that China respects all countries' rights to navigation under international law.

"The Taiwan Strait is an international waterway, and all countries enjoy the right of freedom ‌of navigation," Taiwan's defence ​ministry told Reuters.

The ministry ​said it "closely monitors ​relevant developments through joint intelligence, ‌surveillance, and reconnaissance mechanisms, but ​does not ​proactively disclose the movements of military vessels from allied nations."

(Reporting by Joe Cash; ​Additional reporting ‌by Ben Blanchard in Taipei; Writing ​by Liz Lee; Editing by Himani ​Sarkar and Ros Russell)