Pape Diaw, originally from Senegal, arrived in Florence to study engineering in the late 1970s. Part of a group of 15 African students, he inspired curiosity among his Italian counterparts and the wider community, but never encountered racism. “I remember walking along the street and people would ask to have a photo taken,” he said.

“We were seen as a novelty, but never insulted. When we went to process our residency permits, the police officers would give us coffee.

“Yes, Italy might have been behind [other countries] when it came to cultural mindset, but we were well-received.”

Different times. Ahead of national elections on 4 March, xenophobic rhetoric is dominating a campaign that has turned nasty and divisive. Matters took a toxic turn earlier this month, when 28-year-old Luca Traini injured six African migrants in a racially motivated shooting spree in the central city of Macerata.

Traini had been a candidate at local elections last year for the Northern League, one of two anti-migrant parties that form part of a motley coalition led by Silvio Berlusconi’s Forza Italia. Both the League and its junior ally, Brothers of Italy, are crusading on an “Italians First” platform, targeting the 600,000 migrants who have landed on Italy’s southern shores over the past four years, fleeing war, poverty and oppression. For immigrants of longer standing, the rising hostility towards outsiders has been a profoundly depressing development after years of gradual integration.

Diaw, who helps integrate newly arrived migrants on behalf of Il Cenacolo, a Florence-based social cooperative, traces the change in feeling towards immigrants back to 2007, the year the financial crisis took hold. “When Italians are doing good, when they have money and work, they don’t worry about immigrants. But when they suffer, they lose their heads and look for someone to blame.”

The depth of the growing animosity hit home in December 2011, when Gianluca Casseri, a supporter of the neo-fascist group CasaPound, opened fire at two central markets in Florence, killing two Senegalese street vendors and injuring three others before turning the gun on himself. One of the survivors is paralysed from the neck down.

The political climate at the time was as tense as it is today: the Arab Spring-driven migrant surge had begun earlier that year and Italy was in between governments, after Berlusconi was forced to resign from his third stint as premier amid an acute debt crisis.

Others date the shift from even earlier. Johanne Affricot, born in Rome to a Haitian mother and Ghanaian-American father, first got an inkling of a racist undercurrent in 1994 when she was just 11. It was the year Berlusconi seized power for the first time, within a coalition made up of the Northern League and the National Alliance, a party that had emerged from the post-fascist Italian Social Movement. National Alliance later became Brothers of Italy.

“At school I was the only black person in the class, but I didn’t experience racism from classmates,” she said. “However, I remember watching the TV news and there was a demonstration organised by the League. When a journalist asked someone why they were there, they said they wanted to preserve their Italian identity. It was a moment that made me think that maybe things for me were a little different.”

Affricot is the founder of Griot, an Italian-language online magazine that celebrates African culture and creative diversity. She said the Macerata attack made her feel afraid, not only for immigrants but for Italian society as a whole.

“This campaign has helped advance the far-right parties and has set a precedent that will be very difficult to fix,” she said. “I’m fearful of retaliation against recent migrants and also against those who were born here or have lived here for years.”

Social media is helping to amplify the toxicity of the campaign. In January, Attilio Fontana, a League candidate standing for governor of Lombardy, claimed that the migrant influx threatened to wipe out “our white race”.

Last week a photo of a black passenger on a Rome to Milan train was posted on Facebook, with the adjoining message claiming he had boarded without a ticket. The man was accused of not being able to speak Italian and having “no money and no luggage”, although the writer noted that he “owns a Samsung S8”. The post circulated rapidly before the conductor came forward to confirm the man had a valid ticket.

Diaw and Affricot are among the five million people of foreign origin who have either Italian citizenship or a permit to stay.

“They work, pay taxes, contribute to society … but we never talk about these people,” said Cécile Kyenge, an MEP who moved to Italy from the Democratic Republic of Congo in 1983 to study medicine. “Instead a big fuss is made when 12 migrants move to a town.”

Kyenge had bananas thrown at her and was likened to an orangutan during her brief tenure as integration minister under Enrico Letta’s government in 2013.

She has always maintained that Italy is a tolerant country, and that the attacks came from a small group of ignorant people. But the country is now multicultural, she said, and must do much more in terms of integration. Her role was scrapped when Matteo Renzi, leader of the centre-left Democratic Party, became prime minister in 2014.

Diaw lays the blame at the door of the government, and in particular the weakened leftwing parties, for the racial divisions.

“This is a very ugly period, because leftwing parties used to be very strong, also in the fight against racism and discrimination. Today they are weak.”

Still, he feels buoyed by the way 30,000 people took to the streets of Macerata last weekend to march against fascism.

“It was beautiful … especially to see so many young Italians there. We can only hope that these elections go in a different direction from the one we fear.”