AT THE entrance to the old harbour, the walls of the medieval Fort Saint-Jean are freshly scrubbed. Across a high-level walkway, the sun casts lattice-shaped shadows on a modernist new museum of European and Mediterranean civilisations. Nearby, where ferries dock from Algeria, a waterfront shopping mall opens this month. Marseille, France’s second-biggest city, is trying to reinvent itself as a cosmopolitan place. It drew nearly 5m visitors last year as Europe’s “city of culture”. A five-star hotel has opened above the port. Violent theft dropped by 20% in 2013. “We have had enough of Marseille-bashing,” says Yves Moraine, leader of the local centre-right UMP. “There is a new pride in the town.” Jean-Claude Gaudin, also of the UMP, was re-elected mayor in March.

Yet away from the seafront, in heavily immigrant northern districts, talk of renewal seems otherworldly. In some quarters youth unemployment is more than 40%. In the third arrondissement, the poverty rate is 55%, over twice the city’s average. Rivalry between drug gangs often turns violent. In April a youth was shot dead with a Kalashnikov in broad daylight on the motorway close to the city centre. “There’s a lot of tension here,” says Omar Djellil, a Muslim activist, over mint tea at the El Kantaoui café. People think Marseille is multicultural, he says, “but it’s not. People co-exist, but they don’t mix.”

In March, in the three constituencies covering the city’s northern districts, only one returned a sitting Socialist mayor, Samia Ghali. A locally respected politician (and national senator), she once called for the army to be sent in to deal with drug-related murders. Yet the two other northern districts, which backed François Hollande in 2012, rejected the mainstream left. One, representing fully 150,000 people, elected Stéphane Ravier from Marine Le Pen’s populist National Front as mayor.

Since Ms Le Pen once compared Muslims praying on the streets to the Nazi occupation, this is a shock. One explanation is that Muslim voters were drawn to the message of exclusion, says Gilles Kepel, author of a new book, “Passions française”, which compares Muslim representation in Marseille and the northern city of Roubaix. He says such voters ignore Ms Le Pen’s scaremongering talk of “Islamification”. Instead, they focus on denunciations of mainstream parties and the Paris elite for losing touch with voters.

Another factor is a rejection of the Socialists’ progressive social policy, notably gay marriage, which was legalised last year. Fully 86% of Muslims countrywide voted for Mr Hollande in 2012, according to a poll. But many feel let down and see gay marriage as an affront. “I’m not homophobic, but people just don’t understand why he made this a priority,” says Mr Djellil, who once worked for SOS Racisme, but now grumbles about illegal immigrants and admires Jean-Marie Le Pen, Ms Le Pen’s father. Ms Le Pen has accused Mr Hollande of using gay marriage to distract attention from broken promises on jobs.

Disillusion with Mr Hollande was also seen in high levels of abstention. In the third arrondissement, fewer than half of voters turned out, well below the national average. “There’s a sort of fatalism,” says Mohamed Dahmani, who ran unsuccessfully as an independent in 2012. “We voted Hollande to get rid of Sarkozy, but now we realise that Hollande is no better.”

Up to a point, such political swings may reflect the democratic maturing of the Muslim electorate, no longer beholden to the left. Plenty of French towns without big Muslim minorities also evicted Socialists, and Mr Hollande is the most unpopular French president in modern times. Moreover, apathy goes hand-in-hand with a trend of rising political involvement by a new generation of Muslims, such as Ms Ghali. In 2012 there were more parliamentary candidates of Arab or Muslim origin (400 by Mr Kepel’s count) than at any French election for 50 years. Half a dozen now sit in the National Assembly.

There are other worries about Muslim disillusion. Mr Dahmani, whose Algerian-born father is an imam in Marseille, is troubled by the growing allure of hard-talking, foreign-sponsored Salafists. In Marseille’s tough neighbourhoods, where joblessness is high, this Islam “of beards and veils”, says Mr Dahmani, appeals to those who feel abandoned. It is identity politics, but in a different form. Mr Kepel calls the growth of Salafism in such quarters “new and spectacular”. Countrywide, over 250 young French jihadists have left for Syria, among them teenaged girls. The government is trying to disrupt recruiting networks. “For our parents, Islam was a religious practice,” says Mr Djellil. “Now it has become a political matter.”