QUEBEC — Calling Iran “the most significant threat to global peace and security in the world today,” Canada’s foreign affairs minister, John Baird, abruptly announced Friday that his government had cut all diplomatic ties with the country.

Mr. Baird told reporters in Vladivostok, Russia, where he was attending the Asia-Pacific Economic Cooperation summit meeting, that Canada had closed its embassy in Tehran and given Iranian diplomats in Canada five days to leave. An online list prepared by the Department of Foreign Affairs and International Trade indicated Friday morning that there were 18 Iranian diplomats in Canada.

The action by Canada contrasts with its decision in 1979 to keep its embassy in Tehran open after the United States Embassy there was seized by students and several diplomats were held hostage. Six Americans found sanctuary in the Canadian Embassy and were eventually smuggled out of the country using Canadian passports.

Mr. Baird offered numerous reasons for his decision, including an attack last November by a crowd on the British Embassy in Tehran, which led to concerns for the safety of Canadian diplomats there.