Saudi security forces on Friday prevented an imminent attack on the Grand Mosque in Mecca, the country's Interior Ministry said on state-run TV.
A suspect planning an attack on the mosque blew himself up in a nearby neighborhood when security forces surrounded a home where the man was hiding, according to the ministry.
The suspect refused to comply with demands to surrender, opened fire on security forces and then killed himself, officials said.
The explosion caused the partial collapse of the building in which the suspect was hiding. Six expatriates were injured and taken to a hospital, and five security personnel received minor injuries, a Saudi Press official in London told CNN.
Five people, including one woman, suspected of involvement in the plot were arrested. Three groups, two based in Mecca and one in Jeddah, planned the attack, the Interior Ministry said.
The Grand Mosque, or the Masjid al-Haram, is the largest mosque in the world and surrounds Islam's holiest site, the Kaaba -- a cube-shaped shrine that worshippers circle during the Hajj, the annual pilgrimage that brings millions of people to Mecca.