Jeddah
People walk at Jeddah's historical area Al-Balad during the holy fasting month of Ramadan, Saudi Arabia June 9, 2016. REUTERS/Faisal Al Nasser

A suicide bomber was killed and two other people wounded in a blast outside the U.S. consulate in Saudi Arabia's second city of Jeddah early on Monday, state TV said, the first bombing in years to attempt to target foreigners in the kingdom.

The attacker parked his car outside a hospital near the consulate at about 2.15 a.m. and shortly afterwards his device detonated, killing him and lightly wounding two security men nearby, it said, quoting a security spokesman.

Three further blasts rocked the location of the bombing, a witness told Reuters, as police carried out what appeared to be controlled explosions near the site.

A video sent by the witness showed police taking cover behind vehicles and covering their ears before an explosion sounded.

Reuters could not immediately reach officials to give more details. A photograph on the Sabq news website showed what appeared to be the remains of a man lying next to a taxi.

The witness said the area had been closed off by the security forces and that helicopters were flying overhead. He said the explosion appeared to have taken place about 20 meters (65 feet) from the gate of the consulate.

Islamic State has carried out a series of bombing and shooting attacks in Saudi Arabia since mid-2014 that have killed scores of people, mostly members of the Shiite Muslim minority and security services.

A decade ago, an al Qaeda campaign focused on Western expatriates in the world's top oil exporter, killing hundreds in attacks on businesses and residential compounds. One 2004 attack hit the U.S. consulate in Jeddah, killing nine.