ISTANBUL — The Turkish government reacted with alarm on Wednesday to the seizure of the country’s consul general and his staff by militants in Mosul, Iraq, vowing to retaliate if any of its citizens are wounded.

“Our primary objective is to bring our nationals home in safety,” Foreign Minister Ahmet Davutoglu said in a statement from New York. “No one should try to test the limits of Turkey’s strength.”

Forty-nine Turkish citizens from the consulate — staff members and their families, including three children — were being held hostage in Mosul, the Foreign Ministry said in a written statement. Among them are diplomats, support workers and special forces soldiers. The consul general, Ozturk Yilmaz, is a former adviser to Prime Minister Recep Tayyip Erdogan and an expert on the region. The consulate was raided by members of the Islamic State of Iraq and Syria, or ISIS, the radical group that has been making sweeping territorial gains in northern and western Iraq in recent days.

Another group of 31 Turks — truck drivers who were delivering fuel to a power plant in Mosul — was seized by ISIS militants on Tuesday, officials said.