A 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, wounding two security officers.

The Saudi interior ministry said the two officers suffered minor injuries, while the American embassy in Riyadh said there were no casualties or injuries among US consulate staff.

The ministry did not specify if the bomber intended to target the consulate, saying an investigation was underway.

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 what appeared to be the remains of a man lying on the ground between a taxi and the open door of another car that was peppered with holes.

In a security notice posted on its website, the US embassy noted media reports of "a suspected suicide attack near the US consulate in Jeddah... which occurred in the early morning hours of July 4."

"There are no casualties or injuries among US consulate staff. Media report two Saudi police officers were injured," it said.

"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."