"Six armed elements were killed and a seventh was wounded and arrested," Saudi-owned Al Arabiya television's correspondent said.
One policeman was also killed in the shootout that occurred in a western district of the capital.
An Interior Ministry statement said the seven militants were linked to al-Qaeda.
The television quoted security sources as saying the militants were on the verge of launching unspecified attacks when security forces hit their hideout.
One of the policemen told AFP: "The group was preparing a terrorist operation and its members were being tailed on the basis of intelligence service information."
Policemen at the scene later said they had seized a videotape showing that the group had been plotting to carry out a suicide bombing against a security target in Riyadh within the next two days.
The footage showed the group members making their "will" before the attack, one policeman said.
Islamist activists allied to al-Qaeda have been waging a violent campaign aimed at toppling the US-backed monarchy, which is also the world's biggest oil exporter.
It also wants to expel Westerners.
Officials say about 150 foreigners and Saudis, including security forces, and 130 militants have died in attacks and clashes with police since May 2003, when al-Qaeda suicide bombers hit three
Western housing compounds in Riyadh.
