BEIRUT - Syrian government forces regained control Saturday of areas they lost over the past two weeks to a rebel offensive on the edge of the northern city of Aleppo, ending a major attempt by insurgents to break the siege on eastern parts of the city, an activist group and pro-government media said.

The insurgents had seized a couple of strategic areas in western Aleppo after launching an offensive on Oct. 28 in an attempt to break the siege imposed in July on rebel-held eastern Aleppo, which has also been targeted by waves of Syrian and Russian airstrikes.

Russia said last month that it would halt the airstrikes on the city and urged insurgents to leave. But the fighters, including members of the al Qaeda-linked Fatah al-Sham Front, refused to leave after the government opened corridors for them to cross to the nearby province of Idlib, an insurgent stronghold.

Get Breaking News Delivered to Your Inbox

The Britain-based Syrian Observatory for Human Rights said Saturday that government forces and their allies have regained control of Al-Assad and Minyan districts, west of Aleppo.

“The epic battle for Aleppo has failed,” said the Observatory’s chief Rami Abdurrahman, using the term that the insurgents had assigned to the offensive.

Syrian state media reported that the two districts have been retaken. State TV reported live from inside Minyan, which appeared to be under the firm control of government troops.

“We fought them in every street, house, neighborhood and schools, and they used mosques to launch attacks,” an army brigadier general in Minyan who identified himself as Nabil told Al-Manar TV. The network is run by the Lebanese militant group Hezbollah, which is fighting alongside Assad’s forces.

The Observatory said the fighting left 508 dead, including civilians and fighters from both sides. It said the dead insurgents included 90 foreign fighters while on the government side, 83 troops, 28 Hezbollah gunmen and 41 other fighters from Iran and Iraq were killed as well.

On Thursday, Jan Egeland, the special adviser to the U.N. envoy for Syria, said the last food rations in besieged eastern Aleppo will run out by next week. Speaking in Geneva, Egeland said the last time the more than 250,000 people inside east Aleppo received any humanitarian aid was in the beginning of July. Residents and activists in besieged east Aleppo have spoken of rising prices of food products due to the siege.

Good afternoon. Dear world, we are really running out of food. There's no food in town even if you want to buy it.-Fatemah #Aleppo — Bana Alabed (@AlabedBana) November 13, 2016

Russia’s military says it is willing to consider a new humanitarian pause for Aleppo if U.N. officials confirm their readiness to deliver aid and evacuate wounded and sick civilians.

Defense Ministry spokesman Maj. Gen. Igor Konashenkov said Saturday that such aid had been blocked by the insurgents during previous pauses in the fighting, which “showed that assurances of U.N. representatives about ‘preliminary’ agreements with militants in Aleppo are just words.”

The capture of Minyan and Al-Assad came a day after the Russian military and a main Syrian opposition group traded allegations that the Syrian military or rebels used chemical weapons in Aleppo.

The fighting in Aleppo came as Syrian opposition activists reported government airstrikes on Idlib province.

One of the areas struck on Saturday was the village of Kfar Takhareem, according to the Civil Defense and the Local Coordination Committees. Another was the village of Hazareen, where a fire erupted in the area struck, the Observatory said. There were no immediate reports of casualties.

Syrian and Russian warplanes have been conducting airstrikes on villages and towns in Idlib province for months. A large number of insurgent groups are active in Idlib province including al Qaeda’s branch in Syrian known as the Fatah al-Sham Front.