Saudi officials say there were casualties and hostages may have been taken. After an hour-long gun battle, officials say three attackers are dead and two others are injured and under arrest.
"We have accounted for all Americans on the compound in Jiddah and none of them are being held hostage," said U.S. Embassy spokeswoman Carol Kalin, in Riyadh.
Al-Arabiya satellite television reported four attackers tried to storm the compound in a car and the vehicle then blew up in front of the building.
Officials say the attackers then hit the heavily fortified consulate with explosives and machine guns.
More than an hour after the explosion, gunfire exchanges still could be heard, in an apparent battle between Saudi security forces and at least five attackers who reportedly managed to get inside the compound.
Kalin said the embassy had reports of two people injured among its local staff. Saudi security officials said two security guards at the gate of consulate were wounded, one of them seriously, after the attackers opened fire on them before entering the mission.
A Saudi health official, speaking on condition of anonymity, said several people injured in the blast were taken to a hospital in Jiddah. None are Americans, according to the official.
One witness near the scene told The Associated Press that smoke was rising from the area and said police are keeping cars and traffic from the area. Other witnesses told the AP that gunfire was heard just before the blast.
Khaled al-Maeena, the editor of Arab News located in Jiddah, also said thick smoke was visible from the consulate area and helicopters were flying overhead.
"The magnitude of this assault on the consulate has taken all Jiddah residents by surprise," he said.
The consulate is located in the heart of the city, just a half-mile from the city's Red Sea coastal road.
The building - like all U.S. diplomatic buildings and other Western compounds in Saudi Arabia - has been heavily fortified and guarded since last year's series of bombings against targets housing foreigners.
The attack is the latest in a series of attacks against Westerners since 2003. In May, 22 people were killed, including six Westerners, by militants who sprayed gunfire inside an oil contractor's office in Yanbu, 220 miles north of Jiddah.
In November 2003, a suicide car bomb killed 17 people and wounded 122 at a compound for foreign workers in Riyadh. Al Qaeda took responsibility for the shooting death of a British national in the Riyadh in September.