BEIRUT, Lebanon — The tensions had been simmering for months in the northern Syrian town of Saraqib. Civilian antigovernment activists had complained of rebel fighters who needlessly destroyed a milk factory and treated residents disrespectfully. A growing contingent of jihadist fighters from the ideologically extreme and militarily formidable Nusra Front was suspicious of the activists’ secular, nonviolent agenda.

On Thursday, mistrust erupted into confrontation. Masked men believed to be with Al Nusra raided the headquarters of two secular civilian grass-roots organizations — setting in motion one of the most dramatic tests yet of the makeshift system of local governance that civilians and fighters have established in Saraqib, a rebel-held town.

The dispute also tests the clout of jihadist fighters and the ability of civilian opposition groups to stand up to them. The increasingly prominent role of jihadist battalions on the battlefield worried the United States enough to blacklist Al Nusra last year as a terrorist organization, an effort to isolate it that may have backfired. The Syrian opposition is ambivalent about the group: while many antigovernment activists oppose its vision of an Islamic state and complain of attempts to enforce pious practices, its relatively steady arms supply and string of battleground victories have brought it respect.

The dispute in Saraqib began when a group of masked men raided two organizations run by local activists, a new cultural club and a social work office, the activists said. At the second office, where Danish journalists and two visiting female Syrian activists were staying, the men seized fliers advocating nonviolence and ordered the group to leave town by sunrise, according to activists and one of the journalists, a filmmaker. The masked men were angry, the witnesses said, in part because the visiting Syrian activists were not covering their hair in accordance with the practice of many pious Muslims. The men also declared that they preferred foreign journalists entering the country to be men.