A gunman shot dead two Saudi guards and wounded three others at the gate of the royal palace in the Red Sea city of Jeddah on Saturday, the interior ministry said.

Royal guards killed the gunman, identified by the ministry as a 28-year-old Saudi national armed with a Kalashnikov and three grenades.

"An outpost of the royal guard came under fire by a person who got out of a Hyundai car. He was immediately dealt with and his cowardly act also resulted in the martyrdom" of two royal guards," the ministry said in a statement carried by the official Saudi Press Agency.

Source: b'Royal guards killed the gunman, identified by the ministry as a 28-year-old Saudi national| Source: AFP'

Following this, the American embassy in Saudi Arabia cautioned its citizens after reports of an attack around the royal palace in the Red Sea city of Jeddah.

Saudi news websites reported that security forces had foiled an attack around the Al-Salam palace that left the attacker and at least two Saudi guards killed. However, there was no official confirmation of the incident.

"Due to the possibility of ongoing police activity, American citizens are advised to exercise caution when travelling through the area," the embassy said in a statement.

Source: b'Security forces had foiled an attack around the Al-Salam palace| Source: Representational Image'

The warning comes after the Saudi police raided hideouts of a "terror" cell linked to the Islamic State group this week, killing two people and arresting five, according to the national security agency.

The State Security Agency said police raided three hideouts in the capital Riyadh and exchanged gunfire in one of them, the SPA news agency reported on Thursday.

Since late 2014, the IS has claimed a series of bombings and shootings against Shiites and security forces in the Sunni-majority kingdom.

Saudi Arabia is a member of the US-led international coalition that has been battling the Sunni extremist group in Syria and Iraq.

(Feature Image Source: Twitter)