The likely 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 plot, the official from the Presidency of State Security added.
Saudi Arabia has previously been hit by deadly bombing and shooting attacks by ISIS 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.
In a separate news item, SPA quoted a security source saying it had uncovered the "intelligence activities for the benefit of foreign parties of a group of people against the security, interests, principles, capabilities and social welfare of the kingdom in order to provoke sedition and harm national unity."
The official did not elaborate and it was not immediately clear if the two cases were linked.
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.