A foreign suicide bomber blew himself up near the American consulate in Saudi Arabia's western city of Jeddah in the early hours of US Independence Day on Monday. Two security officers were slightly wounded, the interior ministry said. The American embassy in Riyadh reported no injuries among US consulate staff. General Mansour al-Turki, the interior ministry spokesman, told Saudi-owned Al-Arabiya television that the bomber was not Saudi but a "resident foreigner". Millions of expatriates, many from Muslim-majority nations in the Middle East and Asia, work in the kingdom. Turki told state Al-Ekhbaria news channel that the suspect, in his 30s, was closer to a mosque in the area rather than to the consulate. "Investigations (are) ongoing to find out the goals and motives of the bomber," said Turki. He also said on the news channel's Twitter account that "devices that failed to explode (were) found in the vicinity of the site". The Jeddah incident came during a wave of attacks claimed by the Islamic State group or blamed on the jihadists, including a suicide bombing in Baghdad on Sunday that killed more than 200 people and recent attacks in Bangladesh and at Istanbul's Ataturk airport. It happened before the end this week of the holy month of Ramadan, when Muslims fast from dawn until dusk. The interior ministry said security personnel became suspicious of the man near the parking lot of a hospital which is across from the US diplomatic mission. When they moved in to investigate at around 2:15 am (2315 GMT Sunday) the man "blew himself up with a suicide belt inside the hospital parking lot", the ministry said. A picture carried by the Sabq online newspaper, which is close to authorities, showed a large body part lying on the ground between a taxi and the open door of another car that was peppered with holes. In a security advisory on its website, the American embassy noted media reports of "a suspected suicide attack near the US consulate in Jeddah" early on the morning of July 4. "The US embassy and consulate remain in contact with the Saudi authorities as they investigate the incident," it added, urging Americans to "take extra precautions when travelling throughout the country". - Wave of IS attacks - In March last year the US embassy closed its main office, as well as consulates in Jeddah and Dhahran, for a few days over unspecified "security concerns". The US consulate in Jeddah was targeted in December 2004 when gunmen opened fire and lobbed explosives at the compound. Five people died in the attack blamed on Al-Qaeda. It was not immediately clear who was behind Monday's bombing, but since late 2014 Saudi security officers and minority Shiites have been hit by deadly violence claimed by IS. Branding its rulers "apostate tyrants", IS leader Abu Bakr al-Baghdadi has called for attacks on Saudi Arabia, which is taking part in the US-led coalition bombing the jihadists in Syria and Iraq. In May, the interior ministry said four suspected jihadists died -- two by blowing themselves up -- during a raid east of Jeddah. Two of them had been wanted for some of the deadliest recent attacks in the kingdom. These included the suicide bombing which killed 15 people at a mosque inside a Saudi special forces compound in the southwestern city of Abha last August. Another suspect killed in the May raid was sought in connection with fatal suicide blasts at two Shiite mosques in the kingdom's east. IS-linked violence has also struck neighbouring Kuwait, where on Monday the interior ministry said it had broken up three IS cells plotting attacks in the emirate. Five Kuwaiti nationals were arrested, including a policeman and a woman. Despite the upsurge in attacks against Saudis, foreigners have rarely been targeted in recent years.