SANAA, Yemen — A masked gunman assassinated a Yemeni security official who worked for the US Embassy in a drive-by shooting Thursday near his home in the capital, officials said, adding the assault bore the hallmarks of al Qaeda’s Yemen branch.

The attack comes amid a sharp deterioration of security in Yemen and several other Muslim countries since the collapse of police states controlled by autocratic leaders during a wave of uprisings known as the Arab Spring.

An elite team of some 50 Marines that was sent to Sanaa to bolster security at the US Embassy after a Sept. 13 attack by protesters was scheduled to leave later Thursday and it was not clear if the attack would affect those plans, Yemeni officials said.

The officials noted it was similar to a series of other recent assaults by Al-Qaida’s Yemen branch, although they said it was too early to confirm the group’s involvement. Washington considers the Yemen-based Al Qaeda in the Arabian Peninsula, or AQAP, the most dangerous offshoot of the terror network. It has also been increasingly targeting Yemeni intelligence, military and security officials in retaliation for a US-backed government offensive in the south.

Yemeni security officials, who spoke on condition of anonymity because they weren’t authorized to release the information, identified the slain embassy security official as Qassem Aqlani, in his 50s.

He was on his way to work when a gunman on a motorcycle opened fire at him and fled the scene, they said. The attack was near Aqlani’s home in western Sanaa, while the embassy is located in the eastern half of the city.

Aqlani had been working for the US Embassy for nearly 20 years. Yemeni officials initially said he was the lead investigator into last month’s assault on the compound by Yemenis protesting an anti-Islam film. But US State Department spokeswoman Victoria Nuland said he was not involved in the investigation. In the Sept. 13 assault, protesters stormed the embassy and set fire to a US flag before government forces dispersed them with tear gas.

Al-Qaida’s Yemen branch has called for attacks on US embassies in a bid to take advantage of the anti-American sentiment that has swept the Middle East and other parts of the Muslim world in the past month over the film, which denigrated the Prophet Muhammad.

Initially, the film was linked to a Sept. 11 attack on the US Consulate in the Libyan city of Benghazi that left four Americans dead, including US Ambassador Chris Stevens. US officials said later the attack was not linked to the video.

AQAP praised the killing of US diplomats in Libya, describing it as “the best example” for those attacking embassies to follow.

The group had taken advantage of a security and political vacuum created by last year’s uprising that led to the ouster of longtime leader Ali Abdullah Saleh and seized territories and cities in the south. The government-led offensive has pushed the militants out to mountainous areas from where they have been staging suicide attacks and assassinations inside cities.

Two weeks ago, a top intelligence official, Col. Abdullah al-Ashwal, was also killed in a drive-by shooting in Sanaa.

The US Embassy in Sanaa, located in an upscale eastern neighborhood called Dhaher Hameer, has been heavily fortified with new protective measures amid the turmoil surrounding the uprising, and security was tightened even more after last month’s assault by protesters.

The main road that leads to the embassy is sealed off by cement blocks and three checkpoints limit access, with cars scanned for explosives. Yemeni troops and armored vehicles also are stationed near the building.

Yemeni President Abed Rabbo Mansour Hadi has been reaching out to tribal leaders in southern Yemen to try to secure their loyalty and cooperation in the war against al Qaeda. On Tuesday, while meeting with tribal leaders from Shabwa — a onetime stronghold of al Qaeda— Hadi pressed for unity with the government, warning them against providing shelter to militants and saying the government “will not tolerate anyone who helps al Qaeda.”

Hadi’s call, however, was countered by a daring message from al Qaeda militants, as authorities discovered three decapitated bodies dumped in an open-air market in the eastern province of Marib.

Local media reported that CDs found next to the bodies showed the men confessing to being government informants against al-Qaida and placing tracking devices on cars that became targets for US drone strikes. One of the men said he worked for a tire repair shop and used to plant chips in militants’ vehicles while replacing their tires.