Reports say those held hostage include American, Italian and Dutch workers.

The US embassy confirmed that an American was among the dead, while British officials said they were checking reports that a Briton had been killed.

BBC Middle East correspondent Paul Wood says that with oil at more than $40 a barrel, the attack is bad news for the world's economy.

He adds that by terrifying foreign workers in the oil industry, the militants are also undermining the ruling Saudi royal family - one of their stated aims.

'Child killed'

The militants, reportedly dressed in military-style uniforms, opened fire with automatic weapons on compounds housing oil company offices in Khobar on Saturday morning. Vehicles were left riddled with bullets and some burst into flames.

The gunmen then fled into the luxury six-storey Oasis housing compound and took hostages.

Saudi Arabia's de facto ruler, Crown Prince Abdullah,
said in comments carried by the state-run press agency that four militants had killed about 10 Saudis and non-Saudis - including a female child.

"Security forces will, God willing, deal with them and with others like them with force," he said.

He added that militants would not be allowed to undermine the country's economy.

'Continued gunfire'

A resident of the Oasis compound who hid in a cupboard and phoned relatives in the US from her mobile phone gave a graphic account of early events there.

Vehicles were left riddled with bullets

Her brother-in-law, Oliver Alabaster, told BBC News Online: "She awoke to see black-hooded men enter a house across the street. She then saw her neighbour run out [of] the back door, and then saw her shot in the legs.

He told how the gunmen had "holed up in the house next to hers" and spoke of "continued gunfire between the attackers and the security forces".

The US embassy has reiterated its call to US citizens to leave Saudi Arabia, while Britain repeated a warning to its citizens to avoid all but essential travel to the country.

British Foreign Secretary Jack Straw condemned the attacks and said the UK would stand alongside Saudi Arabia in its fight against terrorism.

Crackdown

Khobar, 400km (250 miles) north-east of Riyadh, is one of the centres of the Saudi oil industry, in which foreigners play a key role.

Earlier this month five foreigners were killed in an attack on a petrochemical site in the city of Yanbu.

The Saudi government launched a high-profile assault on militants following a triple suicide bombing in Riyadh last May, which killed 35 people including nine bombers.

In November, 17 people died when suicide bombers struck at another compound housing mainly Arab foreign workers.

Last week, a German man working for Saudi Arabia's national airline was shot dead in Riyadh.

Our correspondent says there has so far been no exodus of the foreign workers on whom the kingdom relies, but tensions among the expatriate community have never been higher.