Suicide bombers struck three cities across Saudi Arabia on Monday, killing at least four security officers in an apparently co-ordinated campaign of attacks as Saudis prepared to break their fast on the penultimate day of the holy month of Ramadan.

The explosions targeting U.S. diplomats, Shia worshippers and a security headquarter at a mosque in the holy city of Medina followed days of mass killings claimed by the Islamic State group in Turkey, Bangladesh and Iraq. The attacks all seem to have been timed to coincide with the approach of Eid al-Fitr, the holiday that celebrates the end of the Islamic holy month of Ramadan.

A suicide bomber detonated a bomb at a parking lot outside the Prophet's Mosque in Medina, the second-holiest site in Islam, a Saudi security spokesman told state news agency SPA.

"Security men noticed a suspicious person among those approaching the Prophet's Mosque in an open area used as parking lots for visitors' cars. As they confronted him, he blew himself up with an explosive belt, which resulted in his death and the martyrdom of four of the security men," the spokesman said.

Five other officers were wounded, the statement added.

A Saudi security official said an attacker parked a car near the U.S. consulate in Jeddah before detonating the device.

Three cities in Saudi Arabia were targeted by suicide bombers on Monday, killing at least four security officers. (CBC/Google)

A video sent to Reuters by a witness to the aftermath of the Medina bombing showed a large blaze among parked cars in the fading evening light, with the sound of sirens in the background. A picture sent to Reuters showed a burned and bleeding man lying on a stretcher in a hospital.

Other pictures circulating on social media showed dark smoke billowing from flames near the Mosque of the Prophet, originally built in the 7th century by the Prophet Muhammad, who is buried there along with his first two successors.

In Qatif, an eastern city that is home to many members of the Shia minority, at least one and possibly two explosions struck near a Shia mosque. The security spokesman said the body of a bomber and two other people have been identified, without providing any more details.

Witnesses described body parts, apparently of a suicide bomber, in the aftermath.

A resident of the city reached by telephone said there were believed to be no casualties there apart from the attacker, as worshippers had already gone home to break their fasts. Civil defence forces were cleaning up the area and police were investigating, the resident said.

A video circulating on social media and purporting to show the aftermath of a Qatif blast showed an agitated crowd on a street, with a fire raging near a building and a bloody body part lying on the ground. Reuters could not immediately verify the video.

General view of security personnel in front of a mosque as police stage a second controlled explosion, after a suicide bomber was killed and two other people wounded in a blast near the U.S. consulate in Jeddah, Saudi Arabia. This is a still frame taken from video on July 4, 2016. (Reuters)

Hours earlier a suicide bomber was killed and two people were wounded in a blast near the U.S. Consulate in the kingdom's second city, Jeddah.

Authorities identified the attacker as a 34-year-old Pakistani driver named Abdullah Qalzar Khan, who lived with his wife and family in the city.

Foreigners targeted

The Jeddah blast was the first bombing in years to attempt to target foreigners in the kingdom. There was no immediate claim of responsibility.

An official of the U.S. State Department said no American citizens or consulate staff were hurt in the Jeddah blast. He said the United States was aware of reports of explosions in Qatif and Medina and would monitor the situation closely.

He said the State Department encouraged U.S. citizens in Saudi Arabia "to be aware of their surroundings, and keep security and situational awareness levels high."

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 Shi'ite Muslim minority and security services.

The top Saudi clerical body condemned the attacks.

"They are renegades from the [true] religion who have left behind the Muslim flock and their imam, violating all sanctities," the secretariat of the Council of Senior Scholars said in a statement.

"They have no religion," it added.