Iraq said Sunday that Turkey had 48 hours to withdraw an influx of Turkish military deployed near the Islamic State stronghold of Mosul without the consent of the Baghdad government, and warned that it would ask the United Nations Security Council to force their removal.

“Iraq has the right to use all available options,” said a statement from Prime Minister Haider al-Abadi.

The...