AMMAN (Reuters) - The Islamic State group launched a counter-attack against fighters trying to capture the Syrian city of Manbij on Monday, inflicting heavy casualties on the U.S.-backed forces, the Syrian Observatory for Human Rights and the militants said.

Fighters of the Syria Democratic Forces (SDF) carry their weapons as they walk in the western rural area of Manbij, in Aleppo Governorate, Syria, June 13, 2016. REUTERS/Rodi Said

The monitor said the militants won back three villages south of the besieged city in a surprise assault against fighters from the U.S.-backed Syria Democratic Forces. At least 28 SDF fighters were killed.

Two years after IS proclaimed its caliphate to rule over all Muslims from swathes of territory in Iraq and Syria, its many foes are advancing on a number of fronts in both countries. Their aim is to close in on its two capitals, Raqqa in Syria and Mosul in Iraq.

The SDF were poised to enter Manbij nearly three weeks after the launch of a major assault to regain the city backed by U.S. air power and American Special Forces, to seal off the last stretch of the Syrian-Turkish frontier

The alliance, formed last year by recruiting Arabs to join forces with a powerful Kurdish militia, fought to nearly 2 km (1.24 miles) from the city center from the western side on Saturday before retreating.

U.S-led coalition jets hit militants taking cover near a large wheat silo complex on the southern edge of the city that has been encircled by SDF forces.

An SDF spokesman said forces succeeded in repulsing the militant attack and remained positioned on the outskirts of the city, most of whose residents remain trapped inside due to mines planted by the militants, who have dug in to defend it.

“The situation is under control. They have many bodies on the ground,” Sharfan Darwish, spokesman for the Syria Democratic Forces-allied Manbij Military Council, told Reuters.

“We are at the four gates to the city. The whole city is booby-trapped. After 20 days of the campaign, we have yet to storm the city,” he added, adding that some 2,000 people had succeeded in fleeing the city.

Slideshow ( 2 images )

Islamic State militants were also able to roll back the Syrian army, which had reached as close as 10 km (6.2 miles) south of the strategic town of Tabqa, an Islamic State-held city on the Euphrates River, in Raqqa province.

The town, some 50 km (30 miles) west of Raqqa city, the militant’s defacto capital, appears to be the first target of a major Syrian army assault in Raqqa province backed by Russian air power that began earlier this month. [L8N18W058].

Tabqa dam and a major air base have been in militant hands since 2014.

The monitor said the army reverses on Sunday lost it territorial gains made in over two weeks of advances in Raqqa province which enabled it to cross its provincial boundary for the first time in over two years.

Amaq news agency, which is affiliated with the militants, said suicide bombers had attacked Thawra oil field, south of Tabqa, which the Syrian army had captured earlier this week, and regained it.

Eyad al Hosain, a Syrian journalist embedded with Syrian troops, told Reuters the militants had succeeded in regaining areas they lost near the oil field. He did not give figures on army casualties.

“A very intense attack has targeted army and allied positions in Thwara field that led to the withdrawal of troops from areas they liberated... and their retreat,” al Hosain said.

Amaq also said militants seized a Syrian army checkpoint near a strategic junction which leads to Raqqa city that the Syrian government forces and their allies had seized in the early phase of its Raqqa campaign.

The monitor, which tracks violence across the country, said the militants had sent reinforcements and cited at least 300 fighters heading to Tabqa from Raqqa.

State media also reported clashes with the militants around the main Jazal field near the ancient city of Palmyra in the country’s central desert. The army and its allies continue to fight a costly war of attrition against Islamic State militants several months after seizing the city from them.