An apparent suicide bombing and gun attack claimed by Al Qaeda killed 10 soldiers guarding an intelligence building in the western Yemeni city of Hodaida on Friday, security sources said.
The sources said two of the assailants were also killed.
"Gunmen believed to belong to al Qaeda attacked the main gate of the political security building with rocket-propelled grenades and machine guns after a car bomb driven by a suicide bomber attacked the back gate," one of the sources said.
The group claimed responsibility for the attack in a statement issued online, calling its militants "holy warriors".
Al Qaeda and Islamic State have both gained ground in Yemen, where a war has been raging for seven months between a Saudi-led military alliance and Houthi militiamen allied to Iran.
The militant Islamist groups view the Shi'ite Muslim Houthi movement, which controls Hodaida and much of Yemen's north, as apostates deserving death. But Islamic State has also hit out against the Arab military alliance supporting Yemen's embattled government.
In a series of suicide bombings on Oct. 6, Islamic State killed 22 people, including several troops from the United Arab Emirates, at the government headquarters in the southern port of Aden and military bases in the city.
Ground fighting and Saudi-led air strikes have killed at least 5,400 people in Yemen's multi-sided conflict, which started as a civil war among competing factions but has drawn in outside powers in a regional struggle for influence between Sunni Gulf countries and Shi'ite Iran.
Jets from a Saudi-led military coalition bombed the house of Yemen's speaker of parliament on Friday, residents said, as part of a wave of attacks aimed at influential politicians.
The attack hit the residence of Yahya al-Ra'i in central Dhamar province, leaving him unscathed but killing his son.
Residents of the Houthi-controlld capital Sanaa reported around 60 coalition air strikes in the last two days on military bases and houses belonging to family members of Ali Abdullah Saleh, a former president and important ally of the Houthis.
Five civilians were killed in the bombardment of the capital on Thursday, residents said, including at least two children.
(Reporting by Mohammed Ghobari; Writing by Noah Browning; Editing by Mark Trevelyan and Ralph Boulton)