BEIRUT — Syrian security forces fired on a funeral procession in a restive northwestern border region, killing two people and raising Tuesday’s death toll to at least 28, activists said.

The flare-up of violence in Idlib province highlights how Syria’s uprising, which earlier this year involved mostly peaceful demonstrations in small towns and cities, has become a virtual insurgency in the countryside along the Turkish border.

Rami Abdul-Rahman, director of the Britain-based Syrian Observatory for Human Rights, and other Syrian activists said thousands of people were taking part in the funeral for civilians killed there earlier in the day when the gunfire erupted.

Regime forces swept through villages in the area near the Turkish frontier and attacked infiltrators at the border, and anti-regime fighters staged a retaliatory ambush and assassinated a senior officer earlier Tuesday, the reports and Syrian media said.

Military defectors known as the Free Syrian Army have found shelter alongside thousands of Syrian refugees on the Turkish side, making use of mountainous terrain, local smuggling networks and support among villagers on the Syrian side to stage cross-border attacks.

President Bashar Assad’s forces have responded with stepped-up border patrols and reprisal raids on villages where anti-regime protests have been frequent.

The bloodshed in Syria, which the U.N. said Monday has killed at least 5,000, has resulted in increasing pressure on the Assad regime, including sanctions by the United States, the European Union and the Arab League.

Some key nations have resisted the measures. Russia’s foreign minister on Tuesday rebuffed calls for Moscow to back the sanctions and slammed the West for ignoring violence by the Syrian opposition.

The deadliest incident in the past two days took place in two villages near the Turkish border early Tuesday, after security forces entered and shot two civilians dead, Mr.Abdul-Rahman said.

Residents of Maaret Musreen and Kfar Bahmoul responded by closing a main road to the Syrian troops, who then opened fire at random, he said, killing 11 civilians and wounding 26.

The observatory said security forces also killed three other people in the provincial capital of Idlib and two in the central province of Homs.

The Local Coordination Committees, another activist group, gave a similar death toll.

Later in the morning, army defectors retaliated by attacking a security convoy in the nearby town of Bab el-Hawa, killing seven soldiers, Mr. Abdul-Rahman said.