Suspected Islamic extremists wearing military uniforms killed at least 10 people, including one American, and seized dozens of hostages yesterday at compounds filled with foreign oil workers and their families in the Saudi Arabian city of Khobar on the Persian Gulf.

Gunfire could be heard at the site, the Associated Press reported early today, in what was apparently a raid by Saudi security forces on the Oasis Residential Resorts complex. Television footage early today showed commandos jumping out of a helicopter onto a rooftop after sunrise, the Associated Press reported. Security forces had earlier surrounded the attackers on the sixth floor of the high-rise building, a police officer told the Associated Press.

"The forces have begun the raid on the militants," one security source told the Reuters news agency early today. Security officials at the scene said the Saudis were likely to carry out the operation in several stages.

Several hours later, a Saudi security official said that dozens of American, European and other hostages had been freed and that an unknown number of gunmen, including the group's leader, were being taken into custody, the Associated Press reported.

The State Department said the attackers killed one U.S. citizen and wounded another, but there were conflicting reports on the number of casualties and hostages. Security officials said between 45 and 60 people were being held hostage, and reports indicated that they included American, British, Egyptian, Philippine, Lebanese, Swiss and Saudi citizens.

Islamic militant groups, including one affiliated with al Qaeda, asserted responsibility for the attack in statements posted on Islamic Web sites. Some of the statements said U.S. companies were the intended target of the assault on the compound and nearby offices in Khobar, about 250 miles northeast of Riyadh, the capital.

It was the second attack this month against Westerners working in the Saudi oil industry. On May 1, gunmen killed five foreigners and two police officers in the western town of Yanbu. In April, a suicide bomber blew up a building in Riyadh housing Saudi security agents, killing five people and wounding about 150. A German man employed by Saudi Arabia's national airline was gunned down in Riyadh last week.

Islamic militant groups, many of them inspired by al Qaeda and its Saudi-born leader, Osama bin Laden, have stepped up their assaults against the Saudi royal family and the oil industry that has kept it in power. The violence comes at a time of soaring oil prices worldwide, and some analysts predicted that it would add to instability in the energy markets.

Last week, a leading al Qaeda operative in Saudi Arabia, Abdulaziz Muqrin, repeated calls for an uprising to overthrow the country's rulers.

The Saudi government has struggled to contain the insurgents after initially playing down the domestic threat of terrorism before the U.S.-led war in neighboring Iraq. Yesterday, officials repeated their vow to wipe out the militants.

"Security forces will, God willing, deal with them and with others like them with force," Crown Prince Abdullah, the desert kingdom's de facto ruler, said in a statement released by the Saudi Press Agency. "We will continue to chase this deviant group until we eradicate them."

In Washington, Saudi Ambassador Bandar bin Sultan, said: "The terrorists' goal is to disrupt the Saudi economy and destabilize our country. But they will not succeed. With every desperate act of violence, our effort and resolve to destroy the terrorists only grows."

The gunmen began their attack yesterday shortly after dawn, breaking into at least two oil-industry compounds in Khobar and opening fire on Saudi security forces. The militants then entered the Oasis resort complex and took as many as 60 people hostage, Saudi security officials told the Associated Press.

According to Oasis residents and an employee, the attackers asked questions when they arrived that indicated they were trying to separate Muslims from non-Muslims, the Associated Press reported.

A Lebanese woman, Orora Naoufal, who was taken hostage in her apartment, told the news service by telephone that the gunmen released her after learning her nationality, telling her they were in search of "infidels" and Westerners.

Earlier yesterday, the Reuters news agency reported that Saudi security forces had surrounded portions of the resort but held back from rushing the building for fear that the hostages would be injured by their captors. "Security forces are worried about storming because the gunmen have grenades," a Saudi policeman told the news service.

The Arab Petroleum Investments Corp., which has offices in one of the compounds, said three of its employees were killed but did not give details.

The Khobar incident was the bloodiest attack against Western targets in Saudi Arabia since November, when a truck bomb exploded outside a Riyadh housing complex occupied mostly by foreigners, killing 17 people. In May 2003, suicide bombers struck other housing compounds in Riyadh, killing 35 people and wounding more than 200. Both attacks were carried out by Islamic militants with ties to al Qaeda.

In 1996, 19 U.S. soldiers were killed in a bombing attack on the Khobar Towers in the nearby city of Dhahran.

Last month, the State Department warned Americans to leave Saudi Arabia, citing the possibility of more attacks. The U.S. Embassy in Riyadh repeated that warning yesterday.

More than 30,000 Americans live in Saudi Arabia, most of them working in the oil sector. They are among an estimated 6 million foreigners who work in the country, many of them from other Persian Gulf states and South Asia. Saudi Arabia is the world's largest oil exporter.

Saudi police stand near the bodies of three victims of an attack by suspected Islamic extremists at a complex filled with foreign oil workers in Khobar.Saudi commandos land on the roof of a complex where suspected Islamic militants were holding dozens of hostages, most of them foreign oil workers.