When people in Sesto Fiorentino, a suburb of Florence, heard 50 asylum seekers were moving into a former hotel in the historic centre, they responded in much the same way as those in other parts of Italy.

Influenced by scenes on TV of migrants disembarking from boats in the south and a fearmongering campaign launched by local politicians from Silvio Berlusconi’s Forza Italia party, they united in protest.

Petitions were signed, and during a fractious meeting last June residents told Lorenzo Falchi, the 38-year-old leftwing mayor elected a year earlier, of their worries. Falchi opted to challenge their fears. Six months on, Sesto has become a model for how to treat migrants with dignity while keeping local people onside.

“There was a lot of social alarm,” said Dalila De Pasquale, coordinator for Il Cenacolo, a Florence-based social cooperative that manages the Il Gerlino hotel where the migrants now live.

Concerns had mostly centred on the changing face of Piazza Vittorio Veneto, the main square overlooked by the town hall. “People were worried about noise and rubbish, but it was mainly about perception,” said De Pasquale. “They didn’t know who these people were, they were scared to go out at night.”

Antipathy towards the newcomers in Sesto Fiorentino, home to a population of 49,000, was aggravated by the effects of the lingering economic downturn, alongside a perceived breakdown in basic public services in an area that once boasted a thriving porcelain industry.

The scheme to integrate the new arrivals began with a joint mission to rid the square of the residents’ biggest gripe: cigarette butts. Migrants, mostly from Mali, Senegal, Bangladesh and Pakistan, worked alongside a group of pensioners, themselves immigrants from the south. Stories were shared and some common ground was found.

One of the pensioners had spent his childhood in Libya, a former Italian colony and now a major transit route for migrants trying to reach Europe. As he recalled fond memories in Arabic, a young migrant disclosed his traumatic experience of imprisonment there.

The project evolved into a weekly catch-up on the square between local residents and migrants, with business owners also getting involved. Marco Piombanti, owner of the popular Bar Blu, now teaches the migrants how to write a CV and conduct themselves in job interviews.

Falchi said that, despite some people having lingering reservations about the migrants’ presence, tensions have eased a lot. And now Sesto Fiorentino is to become home to a mosque, the first official place of worship to serve the 30,000 Muslims in the Florence area. The go-ahead was eventually given in late December after the Catholic church agreed to sell a plot of land to the Islamic community.

Falchi hopes that this corner of Tuscany can be a beacon of optimism for the rest of Italy, even as parties exploit the migrant crisis for political gain ahead of the general elections on 4 March. Campaigning reached a new low point last week when Attilio Fontana, the far-right Northern League candidate vying to be the next governor of the Lombardy region, claimed the influx threatened to wipe out “our white race”.

Pape Diaw moved to Italy from Senegal 40 years ago to study engineering. He recalls a period when people were more convivial towards each other and strangers. “The connection has been lost,” he said. “We need to get people talking again – knowledge can help dissipate conflict. I look at France and the mistakes they have made with immigration; there is still time for Italy to avoid that.”

Meanwhile in Sesto, as the migrants await the outcome of their asylum requests, a process that can take years, their days are filled with Italian classes, computer training and lessons on how to adapt to their new environment. “We have been helped a lot and are very grateful,” said Apu Khan, a 19-year-old from Bangladesh.

But outside the suburb, a billboard testifies to the challenges that migrants still face. Paid for by the far-right Brothers of Italy party, the hoarding carries a simple message: “No mosque!”