DUBAI (Reuters) - Saudi Arabia said on Tuesday it foiled an Islamic State plot to bomb its defense ministry headquarters and also said it had arrested several people suspected of carrying out espionage in the kingdom on behalf of foreign powers.

Slideshow ( 3 images )

It was not immediately clear whether the two announcements, made separately by a security official to state news agency SPA and a security source speaking to Reuters, were related.

The would-be bombers were identified as two Yemeni nationals living under aliases in the kingdom who were detained along with two Saudi citizens also suspected of involvement in the attack planned for the capital Riyadh, the official from the Presidency of State Security added.

Saudi Arabia has previously been hit by deadly bombing and shooting attacks by Islamic State militants targeting security forces and Shi’ite Muslims.

The assailants were training in the use of explosive belts, the security source added, while authorities said they seized grenades and firearms during the operation to foil the attack.

Islamic State has for years criticized the leadership of Western-allied Saudi Arabia, 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.

In a separate news item, SPA quoted a security source saying authorities uncovered “intelligence activities for the benefit of foreign parties” by a group of people it did not name.

A Saudi security source, who declined to be named due to the sensitivity of the matter, told Reuters that the suspects were accused of “espionage activities and having contacts with external entities including the Muslim Brotherhood”, which Riyadh has classified as a terrorist organization.

“The group is also accused of having contacts with and receiving financial and other forms of support from two other countries to harm the Kingdom of Saudi Arabia and with the aim of destabilizing the security and national unity in preparation to overthrow the Saudi regime in favor of the Muslim Brotherhood,” the source said.

Citing an ongoing investigation, the source declined to name the countries or the members of the group.

The source said one of the detainees is a member of the armed Houthi movement, which is locked in 2 1/2 years of war with a Saudi-led coalition in Yemen, and is in direct contact with the group. The suspects are in custody and will be granted legal rights and due process, the source added.