RIYADH (Reuters) - Saudi Arabia said on Thursday it had dismantled an Islamic State cell in the capital Riyadh, in connection with a plot to launch a suicide attack on the defense ministry.

Slideshow ( 3 images )

Two militants were killed and five others arrested in raids on three locations on Wednesday, an official source in the newly-created Presidency of State Security said in a statement on state-run television.

Deadly bombing and shooting attacks have been mounted by Islamic State militants against security forces and Shi’ite Muslims in Saudi Arabia.

Islamic State has for years criticized 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 U.S. enemies.

Thursday’s statement said a suicide bomber in the eastern Riyadh district of al-Rimal detonated his vest after security forces surrounded a house used to manufacture suicide vests and explosives.

Another militant was killed by security forces after he holed up with firearms in an apartment in the western district of al-Namar, it said.

The third raid was at a horse stable in the southern Riyadh suburb of al-Ghanamia which the statement said had been used as a headquarters.

Security forces seized firearms and bomb-making materials, shown on state television along with a burned out car and a damaged building where the first militant had blown himself up. The suspects were not identified.

Security forces closed off several areas in Riyadh on Wednesday, and videos shared online showed a plume of smoke rising at one location.

The plot to attack the defense ministry, uncovered last month, allegedly involved two Yemeni nationals and two Saudi citizens.

A Saudi security source said at the time that one of the detainees was a member of the armed Houthi movement, which is locked in a 2-1/2-year-old war with a Saudi-led coalition in Yemen.