A gunman who opened fire at the US consulate in Jeddah, Saudi Arabia, and a local security guard working at the consulate were killed in an exchange of fire on Wednesday, the State Department said.

The motive for the attack was not immediately clear, the department said.

The consulate was closed when the shooting took place and no Americans or US personnel were injured, he said.

The assailant was killed by Saudi security forces, the State Department said, referring questions to Saudi authorities, which it said were investigating.

Saudi Arabia’s state news agency, citing Saudi police, said the man had gotten out of a vehicle outside the consulate with a weapon.

«The authorities took the initiative to deal with him as the situation required,» the news agency said. He said the slain consulate security worker was Nepalese.