Authorities in Saudi Arabia have arrested 13 individuals in connection with a foiled attack by fighters from the Islamic State of Iraq and the Levant (ISIL or ISIS) group on a state security building north of the capital, Riyadh, according to the Saudi Press Agency.

The arrests on Monday took place during a dawn raid, the SPA reported, citing a spokesman for the State Security Service. All 13 individuals that were arrested are Saudi nationals, according to the SPA.

The arrests came a day after security forces said they had thwarted the planned assault on the facility in Zulfi, a small city about 250 kilometres northwest of Riyadh. Three policemen were wounded in a gun battle while defending the building, the SPA reported.

ISIL claimed responsibility for the attack through its Amaq website.

Security forces said they killed four alleged ISIL fighters who were behind the operation and later raided a nearby rest-house they said the attackers had rented for use as a bomb factory.

They seized explosive vests, homemade bombs, Kalashnikov rifles and ISIL publications from the building, SPA reported.

Deadly bombings and shootings have been carried out by ISIL against security forces and minority Shia Muslims in Saudi Arabia.

ISIL and al-Qaeda have for years criticised the leadership of the Western-allied kingdom, the world’s top oil exporter, accusing it of deviating from their strict interpretation of Islam and advancing the interests of their United States enemies. Saudi authorities crushed an al-Qaeda uprising over a decade ago.