Saudi Arabia’s security forces shot dead a suicide bomber outside of the US consulate service in the port city of Jeddah, local media reported. The attacker was killed while trying to detonate himself as Americans kicked off 4th of July celebrations.

Two police officers were injured during the attack, according to state TV.

The assailant parked his car outside a hospital near the consulate at about 2:15 a.m. local time (July 3, 2315 GMT). His device detonated shortly afterward.

According to witnesses, the blast took place mere 20 meters from the gate of the consulate.

An eyewitness also told Reuters that three further blasts rocked the scene. Police are believed to have carried out controlled explosions near the site.

None of the consulate employees were hurt in the attack, one of the workers told ABC News.

The US State Department said they were aware of the reports and were working with Saudi officials to find out more.

"All personnel under chief of mission authority are accounted for at this time," a spokesperson told Reuters.

No terrorist group has so far claimed responsibility for the attack.

عاجل | انفجار أمام القنصلية الأمريكية بمحافظة جدة وإصابة شخصين حتى الآن#السعوديةpic.twitter.com/Gnk80fyejD — برقان نيوز (@BurganNewsKW) July 4, 2016

The Jeddah consulate was attacked with explosives and machine guns in 2004. Nine people were killed in the incident.

وسائل إعلام سعودية: تفجير انتحاري بالقرب من القنصلية الأمريكية في مدينة #جدةpic.twitter.com/KOdVE3uKwL — HuffPost Arabi (@HuffPostArabi) July 4, 2016

The attack accomplished its task even though no one but the suicide bomber was killed, since it had a significant psychological impact on the population, Daniel McAdams from the Ron Paul Institute for Peace and Prosperity told RT.

“The whole point of terrorism is to have a psychological impact on people and to convince people to do what they might not normally be motivated to do. Obviously occurring on Independence Day, I would guess [it would] have an impact. This has been a week of horrific terrorism attacks from Bangladesh to Iraq and Turkey as well. What is the reason? Difficult to say, but I think it is to mobilize public opinion,” McAdams said.

The Jeddah incident follows a wave of large-scale attacks claimed by or attributed to the Islamic State terror group that have struck Turkey, Iraq and Bangladesh.

ISIS has been very active during the Islamic holy month of Ramadan, with the group calling on its militants to carry out attacks.

Threats were also reportedly made from a pro-ISIS Twitter account warning of attacks on Los Angeles International Airport LAX and New York's JFK airport as America was preparing to celebrate its July 4 Independence Day.

The account said that planes flying from Heathrow Airport to the US would be used to carry out the attacks.

WARNING: VERY GRAPHIC IMAGE BELOW