BEIRUT, Lebanon — Rebel fighters in Syria, building on the momentum gained by their brazen assassination of three top security officials a day earlier, seized all four border crossings with Iraq and one into Turkey on Thursday, while also claiming for the first time to have captured a pocket of Damascus after intense street fighting.

The government fought back hard, with no indication that its far superior military machine had lost its edge against an opposition still working predominately with small-caliber weapons. Helicopters blasted the northern Damascus suburb of Qaboun with rockets, while the armed forces warned residents of a wide area of the southern part of the capital to evacuate ahead of an assault. Thousands of people fled to neighboring Lebanon.

“They threatened them and gave them 24 hours to leave their homes or they will be shelled,” said Ali Salem, an activist reached via Skype. Even residents in the western Damascus neighborhoods of Mezze and Kafr Souseh, who were not warned, fled in droves as shells thudded into their neighborhood from military positions on the Qassioun mountain above Damascus.

But the government tried to project an aura of calm, even as it unleashed its forces in a manner similar to the devastating assaults on restive cities like Homs, where neighborhoods were effectively flattened and all the residents driven out.