Officials in Saudi Arabia say a security officer has been shot and killed in the holy city of Mecca, just hours after a raid there targeting suspected Islamic State militants.

Police announced on Friday that the shooting happened Thursday night outside of a police station. They say an investigation has begun into Cpl. Khalaf Lafi al-Harithi's killing.

The raid marked the first time Saudi officials have acknowledged targeting the kingdom's Islamic State affiliate near the city home to the Kaaba, the holy cube-shaped shrine of Islam toward which its faithful pray. It comes ahead of this year's hajj pilgrimage in September.

Earlier, authorities said two militants were shot dead in Thursday's, while two others blew themselves up. Security forces say they also arrested two other suspects in Jiddah.