ALEPPO, Syria — “In this court, we just fight Bashar al-Assad,” said Marwan Qaid, the gray-haired, clean-shaven chief justice of the Mohokum al Qada al Motahed, or Integrated Judicial Council. He drew on a cigarette and smiled behind a desk piled high with legal papers. “But in the Shariah Authority, they also fight the infidels. And in their eyes, we are infidels.”

Qaid’s group of pro-rebel judges and lawyers had a bruising encounter last month with the Shariah Authority, a rival Islamic court called Hayaa al-Shariah. Qaid’s people had been renovating the Aleppo Civil Court building — their former workplace under the Assad regime — which was badly damaged during fighting last fall. But just as Qaid was about to move back into his old office, a group of heavily armed fighters from the Shariah Authority arrived and arrested some of his colleagues, accusing them of illegally appropriating the building. The men were later released, but the building still stands empty while the two courts wrangle over which of them should occupy it.

As Syria’s civil war enters its third year, the rebels are struggling to figure out how to govern the large swaths of territory they have seized. In Aleppo, which has no unified rebel command and is riven by factions, the job hasn’t been easy: The city has two rival legal systems, each controlling its own terrain and backed by different militias.

“As there are many different rebel groups, so, too, there are different courts.” —Abdulkader al-Saleh

Faced with the necessity of developing a new Islamic legal code to replace the Assad regime’s secular system, Qaid and his colleagues have selected one developed by the Arab League that is essentially a modernized form of Shariah, or Islamic jurisprudence based on the Koran and the Sunna. By contrast, the Shariah Authority is led by Islamic scholars who base their judgments on their own, more traditionalist interpretations of Koranic law, with only some consultation with lawyers.

Qaid pointed out that the Shariah Authority is supported by the powerful jihadist faction Jabhat al Nusra, which the U.S. government has blacklisted for its alleged connections with Al Qaeda. “They are good fighters, but their goal is to bring about an Islamic country,” Qaid said.

When I raised the question of Jabhat al Nusra’s backing to Abu Suleiman, a member of the Shariah Authority’s main tribunal, he said those fighters were “guests” and would be leaving soon. “We are not Al Qaeda,” he told me, chuckling. “Of course we expect an Islamic system — everyone agrees on this. But it should be a moderate one, where all the groups in the country can coexist.”

The ideological differences between the Integrated Judicial Council and the Shariah Authority — and their significance — shouldn’t be overstated. After all, both systems acknowledge the primacy of Shariah law. And determining the exact relation between state and religion doesn’t seem to be a priority for many fighters in Aleppo.

Abdulkader al-Saleh (widely known as Hajji Marea) is a senior commander of the powerful Liwa al-Tawheed, a local rebel group that pledges allegiance to the ostensibly secularist-leaning Free Syrian Army; nonetheless, he supports both of the city’s rival courts. When I asked why, he played down their divergences: “There’s no government right now. As there are many different rebel groups, so, too, there are different courts.”

The more significant split between the courts is socioeconomic — a reflection of the broader dynamics of the civil war, which has largely been driven by Sunni Muslims from rural backgrounds who suffered a decade of neglect under the Assad government.

Many members of the Shariah Authority come from the countryside or have ties to the petty bourgeoisie in the cities — socially conservative Sunni traders and merchants. The members of the Integrated Judicial Council, on the other hand, are all part of the urban professional class and were relatively privileged by their relationship with the government prior to the war.

And so the question isn’t so much whether Islam will play a central role in postwar Syria: That matter has already been decided by the insurgents’ almost unanimously Sunni character and increasingly religious cast. Rather, the issue is whether the specifics of Islam’s relation with the state will be determined by urban professionals like Qaid or rural traditionalists like Suleiman. And despite any high-minded theological debates, the real stakes will be about which group gets to benefit most from the new order.