BEIRUT, Lebanon — The Syrian military’s widening struggle against insurgents, even in places it had declared secure, again flared into deadly violence on Wednesday, as forces carried out a daylong bombardment in the city of Homs and deployed tanks and helicopters to rout rebels in clashes just outside the capital, antigovernment activists reported.

The activists said that more than two dozen people were killed just in Homs, many as they fled, and that more and more Sunni Muslim families were vacating the city as pro-government gangs called shabiha attacked them.

Homs was the target of relentless artillery barrages by the Syrian military for most of February into early March, followed by official proclamations that a thankful city had been purged of terrorists — the government’s term for armed opponents of President Bashar al-Assad in the year-old uprising against him.

It was unclear on Wednesday whether the military was responding to attacks from insurgents in Homs, or, as the activists asserted, shelling neighborhoods to drive residents out.