A Syrian military academy in the heart of Aleppo made for a bold, even reckless target for opposition forces trying to break a devastating siege, but the rebels gambled on a double advantage: surprise and suicide bombers.

Soon the rebels were sharing pictures of abandoned artillery and a smashed portrait of President Bashar al-Assad on Twitter, flaunted as triumphant proof that the army was routed and opposition forces were within a few hundred metres of their besieged comrades.

Hours later, the people of east Aleppo were dancing in the street, as rebels and activists confirmed that the month-long siege of the area had been broken. The fate of the opposition-held city was back in play. “Morale is very high now,” said activist and poet Mahmoud Rashwani, who had been living largely underground to avoid airstrikes, eking out his supplies of canned food.

The victory is a fragile one. The area is still a conflict zone and it may be some time before a secure corridor for food and medical supplies can be set up, and the regime has called in reinforcements.

“We expect revenge bombing by the regime, including, possibly, chemical weapons,” said Zaher Sahloul, a Syrian-American doctor who coordinates medical aid in the city.

Still, for the rebels, it has been a remarkable triumph against the odds. After months of retreat under pressure from government forces and Russian airstrikes, they have not only broken the siege, but overrun a key base the regime had used to enforce it and apparently taken possession of a large cache of weapons and artillery.

Days earlier, the area’s future had appeared grimly settled, its civilian population facing slow weeks of deprivation and fear, as aid groups warned of a humanitarian catastrophe.

More than a quarter of a million people were hemmed into the battered remains of streets by the guns of Assad’s conscripts, elite Iranian troops and a spectrum of Shia militias, patrolled from above by Russian planes. The rebels had fewer men, fewer weapons and, most crucially, no air force.

The opposition groups called a temporary truce to their own disputes, summoned hundreds of their most battle-hardened troops away from other fronts, and used tunnel bombs and suicide attackers to hit the military base to try to set a counter-siege of western Aleppo.

Both sides are throwing everything they can at the four-year battle for the city – a fight that has come to define the Syrian civil war, because each believes the fate of Aleppo will decide the outcome of the conflict.

“This battle’s results exceed simply opening the road for besieged people; it will overturn the balance of the struggle in the Levant,” said Abu Mohammad al-Jolani, leader of the powerful Jabhat al-Nusra faction that, until last month, was the official al- Qaida franchise in Syria.

Last month, the faction severed those ties, changed its name to Jabhat Fateh al-Sham and renounced international jihad, although observers said there was little sign of a parallel shift in ideology. Instead, experts reckoned the move was probably aimed at getting it off US airstrike target lists and easing coalitions with other factions.

That rebranding put the group in a strong position to capitalise on last week’s campaign, particularly if it can consolidate a victory that casts it as a champion of Aleppo’s battered civilians.

“We urge our people in Aleppo to remain steadfast,” Jolani added in the audio recording released on Friday. “The mujahideen will not fail you.”

The contrast with western powers, which condemned the siege but said they were powerless to stop it, is unlikely to be lost on Syrians, analysts warned.

“The world abandoned Aleppo; the jihadis came to the rescue. Al-Qaida’s rebranding could hardly have asked for more,” analyst Kyle Orton, from the Henry Jackson Society, said on Twitter.

Aleppo is both strategically and symbolically important. Damascus may be the capital but, before fighting broke out, the northern city was the most populous, the economic powerhouse – a diverse, vibrant cultural hub with a history stretching back millennia.

It was late to join the uprising against Assad, producing neither large-scale protests nor the bloody violence that swept through other cities in the first year of the civil war but, since the opposition stormed it in 2012, it has been a crucial battleground.

Aleppo was divided almost immediately into government- and rebel-controlled areas, along lines that have remained mostly static ever since: a stalemate unmoved by repeated and often ruthless attempts to dislodge the other side.

The years of bloody fighting have made it a symbol of Syria’s suffering, encapsulating in one place the bravery of its civilians and the terrible complexity of a war that, even before the rise of Islamic State, has set disturbingly extreme opposition groups against an ever more brutal government.

Fighters from the former Nusra – the groups has been renamed Fateh al-Sham but experts fear their ideology won’t change. Photograph: Omar Haj Kadour/AFP/Getty Images

The eastern half of the city has held out, despite an unforgiving aerial campaign by the Assad regime, whose barrel bombs have reduced much of it to ruins. Rebels have deployed “hell cannons” – crude artillery using gas cylinders – that have also been called indiscriminate.

Aleppo is now the last major urban centre where the rebels have a foothold, and success in breaking the siege would carry great psychological weight, reversing the momentum of months of setbacks brought about by an intense Russian air campaign in support of Assad.

Moscow intervened last year at a precarious time for Assad, who had lost all of Idlib province to a concerted rebel offensive. It was the first time a large coalition of opposition fighters had come together to fight the government and analysts spoke plausibly of Aleppo’s fall to the opposition.

The Kremlin’s campaign ended such hopes, pummelling the rebels, undoing their advances and leaving Assad secure in his strongholds. He, rather than opposition fighters, focused on the push for Aleppo, which culminated at the start of July in a long-feared siege.

Less than a month after being cut off, life in Aleppo has already slowed to a near halt. Markets are empty, schools have closed, hospitals and orphanages moved underground. Residents are woken by the first airstrikes of the day.

Those who chose to stay in Aleppo have stockpiled provisions in the knowledge that the regime and its backers would try to cut them off.

The Syrian army has honed the use of siege warfare to bring cities to their knees and then take them under government control – among them Homs, the birthplace and once the capital of the revolution, which opposition fighters abandoned last year.

Sieges allow Assad to avoid sending a depleted and demoralised Syrian army into close combat with the more highly motivated opposition forces. The Syrian military is down to as little as a third of its prewar strength and reliant on ground forces from Iran’s revolutionary guards, Hezbollah and a patchwork of other regional militias.

Like the opposition, Assad and his supporters are convinced that taking Aleppo will effectively end the civil war, breaking the morale of the opposition and condemning it to a marginal existence as a rural insurgency that can no longer claim to speak for large sections of Syrian society. Bringing all the country’s major cities under his control would also remove the threat that Assad’s international critics could push, as they once did, for a new Syrian settlement that does not include him as leader.

Moderate members of Syria’s opposition in exile say they fear not just for the people of Aleppo, but for the state of their wider cause, and believe the siege aimed not just to humble the city but also to polarise further a war that Assad has always cast as a battle between himself and extremists.

Isis does not have a major presence in Aleppo. Opposition groups in 2014 lost more than 1,000 men, pushing the jihadis back to a small stretch of territory near the town of Manbij, which is now under a concerted assault by US-backed Kurdish and Arab fighters. But many of the groups fighting there are conservative Islamists, and moderates are worried that for this assault they have gathered around Jolani’s group.

It has shored up finances and power base as rivals splintered, and success in Aleppo would further entrench the group. “If the regime, Russians and other supporters had not brought a siege on Aleppo, we could have avoided the coalition of Nusra and the other groups joining it to fight,” said Bassma Kodmani, a member of the main opposition High Negotiating Council team for peace talks.

“The most radical remain in the fight: that is the most alarming consequence of letting Aleppo come under siege,” she said. “The lack of some credible commitment from the international community leaves the opposition welcoming an offensive waged by Nusra because this is the only way to gain some leverage, to put some pressure on Russia and the regime. And that is really unfortunate.”

Rashwani confirmed that relief on the ground in Aleppo means there is little interest in who is doing the fighting.

“No one is now thinking about Nusra or [the hardline Islamist group] Ahrar al-Sham. We are seeing a group of rebels doing their best to break this siege,” he said. “I was one of those people who started this revolution, so I believe that one day we will get our victory, and I need to be here at that moment.”

THE FACTIONS

Assad and his allies

President Bashar al-Assad. Photograph: AFP/Getty Images

Regime forces

The Syrian army numbered 300,000 before the war but, after five years of fighting, it is barely a third of that.

Hezbollah

Hezbollah began to support Assad covertly soon after violence broke out and, in 2013, its leader publicly declared it had joined the war. It is believed to have lost hundreds of fighters, including its top military commander.

Iranian Revolutionary Guards

Iran firmly supports Assad, whom it sees as a key ally in a regional power struggle, and is supplying arms, fuel and hundreds of soldiers. Last year, it released photos of its most celebrated commander on the ground in Syria.

Shia militias

Iranian troops are fighting alongside, and coordinating, Shia militias recruited from across the region, including from Iraq, Afghanistan and even Pakistan.

Russian air force

Last autumn’s Russian air campaign was key to turning the tide of the war in Assad’s favour. Its planes can fly in weather that grounds the Syrian air force and have more powerful and accurate weapons.

Anti-Assad forces in Aleppo

Free Syrian Army

The moderate FSA, made up of many smaller groups, was the dominant opposition force in the first two years of the war. It was initially backed by the Arab states and got cautious US support. After years of disunity and faltering advances, its influence and territory has shrunk, while Islamist groups have grown.

Jaysh al-Fateh

A broad coalition of Islamist factions that came together to fight Assad last year, when its advances forced Russia to come to his aid. Jaysh al-Fateh has been at the heart of the campaign to break the siege on Aleppo. The two most influential groups are as follows.

Jabhat Fateh al-Sham (formerly Jabhat al-Nusra)

The reconstituted al-Qaida affiliate renounced its ties to the global terror group last month and changed its name, but few observers believe that will herald any change in its ideology.

Ahrar al-Sham

Formed by hardliners with Muslim Brotherhood links, who aim to establish a Sunni theocracy in Syria, Ahrar al-Sham fought with Nusra when it was still part of al-Qaida, but rejects international jihad itself. It has a strong support base in Syria.