Interior Ministry spokesman told Reuters: “The four people surrendered to security forces after heavy clashes.
“Nobody was hurt.”
The state-run Al-Ikhbariya television earlier said three of the gunmen had been killed in the clashes.
But security officials said Saudi police killed two armed men during the fighting.
The official Saudi Press Agency said two of the suspects were among seven people who escaped from a detention centre in the capital, Riyadh.
Earlier, General Mansur al-Turki, a spokesman for the interior ministry, said that security forces were besieging the suspects after chasing them into a building in the al-Jamea neighbourhood of the Red Sea city on Monday while trying to arrest four men.
He said that they opened fire on the policemen from inside the building.
The siege continued into the evening. Ikhbariya television said the police evacuated residents of the apartment building, using a crane to lift off an Indonesian driver, his wife and a child who had taken refuge on the roof.
An interior ministry spokesman in the capital, Riyadh, could not confirm any casualties.
Saudi Arabia has been battling a growing insurgency against the monarchy and elements suspected of being linked to al-Qaeda who have carried out a series of bombings and shootings for more than three years.