BEIRUT (Reuters) - Islamic State took control of some Syrian villages in a rebel-controlled area east of Hama on Monday, opening a new frontline days after the Syrian military said it had cleared Islamic State from a nearby area.

Islamic State said in a statement it had taken control of 12 villages and carried out a big attack on the jihadist alliance Tahrir al-Sham.

Tahrir al-Sham, spearheaded by al Qaeda’s former affiliate the Nusra Front, said in its own statement that Islamic State had stormed several villages and accused the Syrian army of allowing it to cross government territory.

A war monitor, the Syrian Observatory for Human Rights, said Islamic State had taken 15 villages from Tahrir al-Sham, but that the jihadist alliance then took five of them back.

On Friday the Syrian army said it had cleared Islamic State from its last pocket of territory in a nearby part of the countryside east of Hama after months of fighting.

The Observatory and Tahrir al-Sham said those same fighters were the ones that captured the villages, appearing to have crossed government-held territory. The Observatory said some of them had crossed with groups of civilians.

Although Islamic State and the groups that make up Tahrir al-Sham, including the Nusra Front, subscribe to hardline jihadist ideology, they have opposed each other for years.

Islamic State has not held territory abutting areas held by jihadists or other rebel groups in northwest Syria, the most populous area held by the insurgency, since last year.

It has since lost swathes of ground to the Syrian army, backed by Russia, Iran and Shi’ite militias, and a rival campaign by Kurdish and Arab groups in the north supported by the United States.