Also Wednesday, gunmen fired on U.S. military personnel in the capital of Riyadh, slightly injuring a driver, the U.S. Embassy said. The Riyadh chief of police said the wounded man was Saudi.
The Interior Ministry, in a statement reported by the Saudi Press Agency, said the two men, one disguised as a woman, were traveling in a car to the Al-Hada region near the western city of Taif, about 700 miles from Khobar.
The car was stopped at a checkpoint where police, suspicious of the woman, asked the two occupants to provide identification, The New York Times reported.
The men were killed after they threw grenades and shot at the security forces, according to the ministry statement, which did not identify the individuals or say how they were connected to a 25-hour shooting rampage and hostage siege that occurred over the weekend. Osama bin Laden's al-Qaida network claimed responsibility for the attack.
A Saudi security official told the AP one of the men was Abdul Rahman Mohammed Yazji, No. 25 on a list of Saudi Arabia's 26 most wanted militants.
In Wednesday's incident in Riyadh, gunmen fired at two cars carrying U.S. military personnel near a Saudi National Guard compound where a U.S. training unit is based.
The militants had automatic rifles and fled after the shooting, security sources said.
The weekend attacks and continued instability in the region caused oil prices to reach record highs before retreating slightly Wednesday.
Organization of Petroleum Exporting Countries President Purnomo Yusgiantoro told reporters that OPEC should assess each of its 11 members' ability to produce more because of skyrocketing costs, according to the Associated Press.
A formal OPEC meeting on production policy commences Thursday.