ERBIL, Iraq — In northern Syria, the jihadists of the Islamic State have fixed power lines, dug sewage systems and painted sidewalks. In Raqqa, they search markets and slaughterhouses for expired food and sick animals. Farther south, in Deir al-Zour, they have imposed taxes on farmers and shopkeepers and fined men for wearing short beards.

The group runs regular buses across the border with Iraq to Mosul, where it publicly kills captives and trains children for guerrilla war. Last month, it reopened a luxury hotel in the city and offered three free nights to newlyweds, meals included.

A year after the Islamic State seized Mosul, and 10 months after the United States and its allies began a campaign of airstrikes against it, the jihadist group continues to dig in, stitching itself deeper into the fabric of the communities it controls.

In vast areas of Syria and Iraq with shattered ties to national governments, the jihadists have worked to fill the void, according to interviews with residents from areas in Syria and Iraq ruled by the Islamic State, also known as ISIS or ISIL. The group is offering reliable, if harsh, security; providing jobs in decimated economies; and projecting a rare sense of order in a region overwhelmed by conflict.