Saudi officials have said the leader of a group that killed 22 people, mostly foreigners, during a shooting and siege in Khobar was al-Qaeda trained.
Police have set up roadblocks in a bid to catch the escaped gunmen
The gunman, wounded and taken prisoner on Sunday, was high on their wanted list and a veteran of al-Qaeda training camps in Afghanistan, they added.
A manhunt is under way for three other gunmen involved in the attack, who escaped in unclear circumstances.
One survivor has claimed security forces allowed the men to escape.
In a version of events that has not been confirmed, the hostage was quoted as saying the gunmen were set free in return for not blowing up the building with everyone in it.
The Saudi government believes that militants at work in the country still have contact with Osama bin Laden for guidance and advice.
However, the Saudi ambassador to Britain, Prince Turki al-Faisal, has rejected any idea of collusion between the attackers and the security forces and insisted the authorities were fighting terror groups using all means available.
Britain is advising against all but essential travel to Saudi Arabia, but has not yet followed the US in telling its citizens to leave.
However, the UK ambassador to Saudi Arabia has warned that more attacks are likely.
Sherard Cowper Coles said that there are dozens of armed extremists at work and that there are more attacks in advanced stages of preparation.
1. Al-Khobar Petroleum Centre: Four gunmen arrive at 0715 Saturday, shoot at guards, enter building and fire at employees.
2. Arab Petroleum Investments Corp: Gunmen shoot British employee dead in his car at gate.
3. Oasis compound: Gunmen enter compound and take about 50 people hostage on sixth floor of hotel building. At 0530 on Sunday, Saudi forces land on roof and storm building. Nine hostages are found dead, 41 are released. Three militants escape, one is arrested.
Those attacks are becoming more daring and more deadly, and it is now clear that al-Qaeda is a very real threat to foreigners in Osama bin Laden's homeland, says BBC correspondent Paul Welsh.
The Interior Ministry said 41 hostages were freed on Sunday morning when Saudi commandos stormed the Oasis residential compound, which houses company executives.
In all, 22 people were killed. Thirteen people were gunned down on Saturday, and nine hostages were killed after they reportedly tried to escape during the night.
Residents of the compound say the militants separated Muslims from non-Muslims, saying they only wanted to hurt Americans and other westerners.
An audiotape posted on an Islamic website claimed the attack for al-Qaeda. "We will cleanse the Arabian peninsula of infidels," the tape said.
The Saudi Interior Ministry says the foreigners who were killed came from Britain, Egypt, India, Italy, the Philippines, South Africa, Sri Lanka, Sweden, and the US.
It said 25 people of different nationalities were wounded.