Hundreds of Saudi policemen are surrounding a compound where militants who earlier killed at least six people are holding a number of hostages.
The Lebanese ambassador to Saudi Arabia says five Lebanese hostages have been released, but others were reportedly still being held.
The gunmen escaped into the compound following attacks on three compounds in the eastern oil city of Khobar.
At least four foreigners were among the dead, including an Egyptian boy.
At least one American was among the foreigners killed, and British officials are heading to Khobar to check on reports that a British national was killed.
A statement purported to be from al-Qaeda, carried on an Islamic website, has claimed responsibility for the attack.
Western diplomats said gunmen attacked three compounds housing the offices of oil companies and residential homes of employees working there.
Security sources were surrounding the Oasis compound in the city, amid reports of further gunfire.
"The whole area is closed," Naif Al-Mazrooa, a resident of the city, told BBC News Online.
"There are helicopters flying around the area."
The Lebanese ambassador said five hostages had been released.
"We still don't know the circumstances of their release," Ahmad al-Mashat told AFP news agency.
He said the Lebanese nationals from two families were among a large
number of hostages.
Witnesses said there were at least four gunmen, who wore military-style dress and used a small car and a sports utility vehicle.
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.
Islamic militants from groups affiliated to al-Qaeda have been conducting a campaign against the Saudi state.
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.
Earlier this month five foreigners were killed in an attack on a petrochemical site in the city of Yanbu.
Last week a German man working for Saudi Arabia's national airline was shot dead in Riyadh.