This video image provided on March 21 by the Syrian militant group Ahrar al-Sham shows flames rising from trucks during a battle between rebel fighters and Syrian government forces, in an eastern neighborhood of Damascus. (Ahrar al-Sham, via AP)

An unexpected rebel push on Damascus has brought Syria’s civil war to the heart of its capital for the first time in years, spreading panic among residents and serving as a reminder that the conflict is far from over.

Streets emptied and many shops and schools were closed for a third day Tuesday as battles raged on the eastern edge of the city, where the rebels launched their surprise assault over the weekend. Mortar shells crashed into residential neighborhoods, jets streaked overhead, and the rattle of gunfire plunged Damascus back onto the front lines of a war that has raged since 2011.

The rebel offensive seems unlikely to lead to any sustained ad­vances into President Bashar al-Assad’s most vital and best-defended stronghold. Loyalist forces­ scrambled troops from other areas to defend the capital and appeared to have halted the rebel advance just beyond Abbassiyeen Square, a major gateway just a few miles from the historic Old City of Damascus.

The fighting marked the first time since 2012 that rebel forces­ have advanced so close to the center of Damascus, highlighting the continuing fragility of Assad’s hold on power despite nearly a year and a half of steady gains — aided by Russia’s military intervention — that appeared to have sealed the outcome of the war.

Syrian civil defense volunteers, known as the White Helmets, extinguish a fire reportedly caused by airstrikes in the rebel-controlled town of Hamouria, on the outskirts of the capital, Damascus, on March 21. (Amer Almohibany/AFP/Getty Images)

It is now becoming clear that although the rebels lack the capacity to topple Assad, Assad’s forces­ also lack the capacity to defeat the rebels, said Andrew J. Tabler of the Washington Institute for Near East Policy.

“This doesn’t mean the regime is going to be defeated. But their forces­ are just too thin,” he said. “They stand in one place, they contract in another, they shift forces­ to another, and this has been going on for years.”

The offensive called into question the viability of Russian-led efforts to stabilize the country by securing a negotiated settlement, a goal that remains as elusive as Assad’s repeated vows to regain control of the entire country. Stalled peace talks are due to resume in Geneva on Thursday, but the upsurge in fighting cast further doubt on the chances­ for progress.

The United States has dropped out of the diplomacy pending a decision by the Trump administration on its Syria policy, leaving peace efforts adrift.

A Russian-sponsored cease-fire that took hold in December was already fraying badly, and is now in shreds. The Damascus offensive was preceded by days of intense government airstrikes, aided by Russian warplanes, in the northern province of Idlib, the rebels’ biggest remaining stronghold, according to activists and residents. Dozens of civilians have been killed in the strikes, reviving fears that the government is planning an onslaught there on the scale of the massive assault that killed thousands last year in the city of Aleppo.

Government forces had been steadily advancing into the shrinking en­claves of rebel-held territory surrounding the capital, despite the cease-fire. The immediate goal of the rebel offensive was to defend a besieged foothold in the suburb of Qaboun, which was at risk of being overrun, and link it with Jobar, a bigger enclave on the eastern edge of the city, rebel commanders said.

More broadly, the assault is also intended to pressure Russia to make the Assad government observe the cease-fire, said Wael Olwan, a spokesman for Faylaq al-Rahman, the main rebel group participating in the offensive. “By adopting the strategy of defense by offense, hopefully we will force Russia to force the regime to commit to the cease-fire agreement,” he said.

There was no immediate sign that the strategy was working. New airstrikes were launched late Tuesday against the city of Idlib — by Russian warplanes, according to activists in the area, although that could not be independently confirmed.

Rebel leaders see Russia, now the main power broker in Syria, as trying to push them into a peace deal that would help Assad reclaim all of Syria.

“The problem is Russia’s double standards,” Olwan said. “While the Russian foreign minister talks about a political solution, their military bases­ on the ground are doing the opposite. They are taking part in strikes that contradict what they are saying about a political solution.

The rebels also remain hamstrung by factional disputes, said Aron Lund, a fellow with the Century Foundation. The moderate Faylaq al-Rahman teamed up with units of the more extreme Tahrir al-Sham to launch the Damascus assault. But the biggest Damascus faction, Jaish al-Islam, is a fierce rival of the group that led the offensive and has not joined the fighting — just one example of how splits have thwarted the rebels throughout the six-year-old crisis.

Were the rebels to unite, “that could mean real trouble for the government,” Lund said. “There is still a lot of fight left in the insurgency. But only if the government somehow cracks from within or screws up in the most spectacular fashion will they have a chance to break out and challenge Assad’s hold on the capital.”

Zakaria Zakaria in Istanbul and Heba Habib in Stockholm contributed to this report.