BBC News Online details the 25-hour crisis in Khobar, Saudi Arabia, when four gunmen went on the rampage, taking about 50 hostages and killing 22 people.
At 0715 local time on Saturday, four militants in military-style clothing arrived at Al-Khobar Petroleum Centre.
They opened fire on guards, entered the compound and began shooting at employees.
1. Al-Khobar Petroleum Centre: Houses offices including Royal Dutch/Shell Group, Aramco (Saudi),
2. Apicorp: Investment arm of Organization of Arab Petroleum Countries, project finance manager Michael Hamilton killed
3. Oasis Resort: Heavily fortified luxury residential site containing 200 villas, 48 apartments, 195 studios, a hotel, restaurants, spas, swimming pool and ice rink
A diplomat in Khobar told the Associated Press that two Filipinos were killed.
The militants then headed to the offices of the Arab Petroleum Investments Corp, Apicorp.
Witnesses quoted by Reuters news agency said they drove cars with military markings into the compound.
Apicorp's project finance manager, Michael Hamilton, a Briton, was killed.
Witnesses said he was shot in his car as he arrived at the gate of the compound, and that his body was dragged through the streets.
An Apicorp official said that two Saudi guards at the gate were also killed.
The gunmen also opened fire on other cars during their shooting spree, including one carrying several children to school. A 10-year-old Egyptian boy was killed.
The next target was the heavily-fortified luxury Oasis Resort compound, which is home to many expatriate workers.
Hostages were held overnight on the sixth floor of the Oasis hotel
It is not clear how the gunmen entered the compound.
A Saudi Interior Ministry statement said they scaled the Oasis compound's walls after attempting to drive in using a vehicle rigged with explosives.
But other reports say they entered by a side gate next to an Italian restaurant in the compound.
Eyewitness reports then describe the gunmen storming through the compound threatening residents, searching out those who were not Muslim.
Around 50 hostages were taken and held on the sixth floor of a high-rise hotel building on the compound.
Two Sri Lankans
One South African
At 0530 on Sunday, about 40 Saudi troops were airlifted in helicopters onto the roof of the building.
Officials said the raid was launched when the gunmen began killing hostages.
An earlier attempt to storm the building from the ground had been abandoned because the building was booby-trapped, according to Saudi security sources.
It is not clear exactly what happened when the troops stormed the building, but Saudi officials said 41 of the hostages were freed and nine were found dead.
Some reports said the throats of some of the dead had been slit.
The leader of the gunmen was wounded and arrested, the Saudi Interior Ministry said.
But the other three militants escaped, holding hostages at gunpoint for cover, officials said.
In all, the Saudi Interior Ministry said that 22 people had been killed, and another 25 injured.
Officials said that 201 people had been evacuated from the Oasis compound in addition to the 41 hostages who were freed.