The shots were fired from a moving car towards the Seder Village compound on Friday night.
Although there were no injuries from the attack it appeared to be the latest hit-and-run strike against foreign targets in the kingdom.
Insurgents have waged a 17-month campaign of violence against foreigners and security forces in Saudi Arabia.
The Saudi Gazette newspaper quoted Seder Village manager Richard May as saying an explosive device “like a big firecracker” was also thrown at the complex, which like other expatriate compounds is defended by members of the Saudi National Guard.
Interior Ministry security affairs spokesman Brigadier General Mansur Turki said police were searching Riyadh for the car used in the shooting. Up to four people might have been involved, he said.
Saudi officials, who accuse the insurgents of belonging to al-Qaida, say they have succeeded in destroying four cells and infiltrating a fifth. Diplomats say the recent attacks show that armed groups, although weakened, can still strike.
More than 80 foreigners have been killed since the triple bombings of expatriate compounds in Riyadh which killed 35 people last May.
Last month a British citizen and a Frenchman, were shot dead in separate attacks in Riyadh and in Jidda.
Two small bombs also exploded outside banks seen to have British and US links, and a car carrying US consular staff was fired on.