It was not clear if the raid was linked to Saudi Arabia's crackdown since suicide bomb attacks on May 12 targeting Western residential compounds in the capital Riyadh. The attacks, blamed on al Qaeda, killed 26 people, including nine Americans. Nine Saudi attackers also died.
At least five people were arrested in the raid, including two Chadians, an Egyptian and a Saudi, a Saudi interior ministry official said.
The unidentified official, whose remarks were carried by the official Saudi Press Agency and state television, said a number of other suspects also were arrested in Mecca, Islam's holiest city, 450 miles west of the capital, following the raid. He did not elaborate.
At about 9:30 p.m., Saudi security agents broke into an apartment in al-Khalidiya district about three miles from Mecca's main mosque, where "a group of terrorists ... were preparing an imminent terrorist act," the official said. He did not say what the intended target was and gave no other details on the alleged plot.
Five suspects were killed in a gun battle initiated by the "terrorists," he said. Two police were killed and five injured; and four bystanders were slightly injured, the official said.
The official said the apartment was booby-trapped with explosives. Some 72 bombs of different sizes were found in the apartment along with a number of weapons, including semiautomatic rifles and knives, and communication devices, bomb-making materials and masks.
Saudi authorities, accused of acting too slowly against Islamic extremism after the Sept. 11 attacks, have taken pains to show their commitment to fighting terrorism in the kingdom, the birthplace of bin Laden and 15 of the 19 Sept. 11 hijackers.
In a report Sunday, the Saudi newspaper Okaz had said the violence started when traffic police tried to stop a car whose occupants fired on officers and fled to the apartment building.
The Interior Ministry did not mention the attempted traffic stop.
Security was unusually tight in Mecca on Sunday, with troops stopping cars for searches and to check drivers' identification on the outskirts and at checkpoints scattered throughout the city. A number of police patrolled inside and outside Mecca's Al-Nur hospital, where those wounded Saturday were taken.
Abdul Khaliq Reheem Sheik, a 50-year-old Indian driver who was being treated for cuts at Al-Nur Sunday, said three masked men holding guns had approached him as he washed his employer's car in Mecca's al-Khalidiya district Saturday night.
The men demanded he drive them away from the area, Sheik told The Associated Press. When he refused, they shot at the car's windows, apparently to frighten him, and he was injured by flying glass. The three then drove away in the car, leaving Sheik behind. It was not clear if the three were still being sought or were among those killed or arrested Saturday night.
Helicopters hovered over al-Khalidiya into the early hours of Sunday. Sunday afternoon, dozens of police and special forces troops armed with rifles could be seen around the three-story apartment building, whose facade was pocked with bullet holes. Residents who had been kept out overnight were being allowed back in the area, after first stopping at a police check point to have their identities checked and cars searched.
Officials have reported violence linked to the crackdown on extremism only once before since May 12. On May 31, Yosif Salih Fahd Ala'yeeri was killed in a gunfight with police in northern Saudi Arabia. He was allegedly carrying a letter written by al Qaeda chief Osama bin Laden.
Earlier, Saudi authorities had announced the arrests of a number of people in Medina, Islam's second holiest city, 540 miles west of the capital. Saudi authorities had said the arrests were peaceful, but security in and around Medina has been tight.
Last week, a Western diplomat said at least seven suspects linked to the Riyadh bombings have died since those attacks, some in clashes with Saudi authorities. The diplomat had no details.
Mecca is the birthplace of Islam and its seventh-century prophet, Muhammad, and the focus of the annual pilgrimage known as the hajj. Muhammad is buried in Medina. Reports of police clashes in those cities could anger Islamic militants who already accuse Saudi authorities of being little more than puppets of the "infidel" United States.