An armed man exchanged fire with Saudi security forces near the US consulate in Jeddah on Wednesday and was killed in the shootout along with a Nepalese security guard.
A gunman was killed in an exchange of fire with security authorities on Wednesday near the mission, SPA reported, quoting a police official.
"A person riding in a car stopped on Wednesday near the US consulate building in Jeddah and got out of it carrying a firearm in his hand," a spokesman for the Mecca regional police said.
"So the competent security authorities took the initiative to deal with him as required by the situation, and the exchange of fire resulted in his death," the official added.
A Nepalese guard at the consulate also sustained an injury that led to his death later, the spokesman said.
The agency said that security investigations were under way to determine the circumstances of the incident.
No US citizen was injured in the incident, according to Saudi Arabian media.
The incident took place days before the US Independence Day on July 4.
In 2016, a suicide bomber blew himself up near the US consulate in Jeddah, slightly injuring two security staff, the monarchy's Ministry of the Interior said at the time.