A firefight ensued at dawn on Monday after security forces besieged the men, who were hiding in a villa in an east Riyadh neighbourhood where several Western residential compounds are located.
Witnesses said they heard the sound of heavy gunfire and what appeared to be mortars as security forces surrounded the area and sealed it off before dawn.
The shoot-out ended after two hours with the death of all of the men inside the building, the security sources said.
One source said the men were traced partly through internet surveillance. An internet statement was issued at the weekend claiming that al-Qaida was behind an attack on the world's largest oil-processing plant in Abqaiq on Friday.
The Saudi Interior Ministry said the five suspects holed up in Riyadh's al-Yarmuk quarter, who battled police for an hour after being surrounded in the early morning, were linked to the failed Abqaiq attack.
"At dawn, security forces launched simultaneous operations to assault a building in al-Yarmuk quarter that the suspects had
transformed into a bolt hole for treason and a base for attacks," said a ministry statement carried by the official SPA news agency.
"After an intense exchange of fire, security forces succeeded in resolving the situation quickly and all those who were at the site - and there were five of them - were killed."
In a further operation in the east of Riyadh, another suspect was arrested, the spokesman said, adding that the security forces had suffered no losses in the raids.
Riyadh has seen a number of
clashes in the last two years
A police officer on the scene told AFP that large quantities of arms and explosives as well as materials for making bombs had been seized in the house where the suspects were hiding.
The suspects "used grenades in a bid to flee but they were prevented from doing so", the officer added.
Ambulances were rushed to the scene but the area around the siege house remained sealed-off to regular traffic amid a heavy security presence. Two helicopters hovered over the scene of the hour-long shoot-out.
The names of the five dead men were said to be on a Saudi most-wanted list of 36 suspected al-Qaida fighters.
A Saudi analyst of al-Qaida affairs told AFP that security forces had tracked three of the five slain insurgents to the hideout from Abqaiq.
"Three people escaped and fled," said Fares bin Hizam.
"The police followed the car - it was a Toyota Land Cruiser. They found them in this small house. Two other people were with them. They kept a lot of bombs and guns there.
Security forces did not suffer any
loss during Monday's gun battle
"One of those killed is the leader of the group that attacked Abqaiq," he added.
Bombers attempted to penetrate the world's largest oil-processing plant at Abqaiq, in the oil-rich eastern province on Friday, but their attack was thwarted, leaving two security men dead.
At least four attackers and two security guards were reportedly killed in the attack.
Abqaiq handles crude pumped from the giant Ghawar field and ships it off to terminals Ras Tanura, the world's biggest offshore oil loading facility, and Juayma.
It also pumps oil westwards across the kingdom to Red Sea export terminals.
An al-Qaida statement posted on the internet claimed responsibility for the attack by two "martyrdom-seekers" in what the group said was a successful attack, vowing defiantly to attack more Saudi oil installations.
Friday's raid targeted the world's
largest oil-processing plant
The posting attributed to the group named the attackers as Muhammad al-Ghaith and Abd Allah al-Twaijri - both on a list of top wanted Saudi insurgents - and said Friday's attack was in response to a call by al-Qaida leader Osama bin Laden to target oil installations.
"We shall not cease our attacks until our territories are liberated," said the statement, adding that the operation was successful and that some attackers got away.
Vow to crush
The statement said the attackers were able to get through two gates and blew themselves and their vehicles up as planned, rejecting Saudi state media reports that security forces stopped the attackers.
"We renew our vow to crush the forces of the Crusaders and the tyrants and to stop the theft of the wealth of the Muslims," said the statement signed by al-Qaida in the Arabian Peninsula.
The authenticity of the statement, posted on a website often used by Islamist groups in Iraq, could not be verified.