Militants attacked two Syrian security offices in the western city of Homs on Saturday with guns and suicide bombers, killing at least 42 people including a senior officer, a war monitor said.

The attackers killed the head of military security and 29 others at one of its headquarters in the city and 12 more people at a branch of state security in attacks that began early in the morning, said the Syrian Observatory for Human Rights.

Syrian state television reported that clashes had rocked the districts of al-Ghouta and al-Mohata, where the two targets were located, before three suicide bombers detonated their explosives at each place. It did not give a death toll.

It was not immediately clear if the militants were from Islamic State or other groups, the Observatory, a Britain-based war monitor, said.

IS has carried out bombing attacks in the city, which is under government control except for one besieged district held by more moderate rebels. Several bombings have targeted Syrian cities held by the government of President Bashar al-Assad in recent months.