These days, Civita has become a tourist destination for day trippers, who arrive by the busload and pay a small fee to enter. Sometimes up to 5,000 people a day wander the town, which at its seasonal height sleeps only about 100. The effect of all these people — selfie sticks moving through the air like antennae — gives the place the unfortunate air of a Disney set: a hyper-clean, historically accurate medieval town as realized on a Universal Studios back lot. There is nothing to mar the scene — no pizzerias or Starbucks or even cars. And just as one starts to wonder what kind of town is one in which there are no children or families, no banks or offices, dusk starts to fall, and the tourists and the white heat of the day retreat. Things go quiet, the light glows pink and the ‘‘locals,’’ many from Rome and the U.S., start to appear — there are drinks on terraces and quiet dinners in the side streets, conversations in private gardens among neighbors and friends who know one another, and who all love and care for this enchanted, imperiled piece of history.

Image Some of Italy’s virtually abandoned villages are right outside of major cities. Credit... T magazine

BUT THE FARTHER ONE gets from major cities like Florence or Rome, the more difficult it is to attract weekend tourists. Deep in Sicily, off a terrible road whose signs resignedly warn of potholes, lies the isolated town of Sutera, built around the base of a steep mountain. In 2013, at the behest of its mayor, the town opened its doors — and its empty houses — to survivors of the catastrophic Lampedusa shipwreck, which killed more than 360 refugees. Sutera’s population had dwindled from 5,000 in 1970 to just 1,500, and the mayor recognized the humanitarian and economic opportunity the migrants could provide for his moribund town. To help the refugees, most of whom are from sub-Saharan Africa, integrate into the community, they are paired with local families, and required to take Italian lessons, given to them by the town’s citizens. (The European Union provides funding for food, clothing and housing, which can spur the creation of jobs for both migrants and locals.) Initially, there was some resistance, but that has disappeared with the energy these newcomers have brought to the area. Today, one can find young Nigerians taking their morning espresso alongside the old men, and local children kicking soccer balls in the street with their new playmates. And each summer the town hosts a daylong festival featuring the traditional food, music and dance of the immigrants.

One of the first towns to invite migrants into its walls was Riace, in Calabria, whose mayor, Domenico Lucano, was named one of Fortune’s ‘‘World’s 50 Greatest Leaders’’ last year. By 1998, when it took in a group of Kurdish refugees, Riace’s population had fallen to around 800 from 2,500 after World War II. Today, its population is 1,500, with migrants from over 20 countries. Some of these are apprenticing artisans, learning old skills like embroidery, glass mosaic and pottery that were themselves dying out, and so helping keep Italian culture alive. Lucano told the BBC, ‘‘The multiculturalism, the variety of skills and personal stories which people have brought to Riace, have revolutionized what was becoming a ghost town.’’ Other towns have taken Riace’s lead, too: an act of humanity that has become an act of self-preservation as well.