IT WAS supposed to be a sneaky afternoon cigarette break. Then a gunman in black appeared and shot 15-year-old Robin Sinisalo in the head. His older brother Alejandro was shot four times. Robin died immediately on the doorstep of his home in north-west Stockholm. Alejandro was left in a wheelchair for life. Two years later, the boys’ mother, Carolina, says the police still have no leads.

Robin’s fate is increasingly common in Sweden. In 2011 only 17 people were killed by firearms. In 2017 the country had over 300 shootings, leaving 41 people dead and over 100 injured. The violence mostly stems from street gangs running small-time drug operations in big cities such as Stockholm, the capital, Malmö and Gothenburg. Gang members have even used hand grenades to attack police stations. Between 2010 and 2015, people were killed by illegal firearms at the same rate as in southern Italy. Though Sweden is still a relatively peaceful place, this is worrying.

Gangs are nothing new: bikers and Balkan mafiosi have traded drugs and occasional bullets in Sweden since the early 1990s. But the gangs emerging today are less organised and more prone to commit petty crime. Acquiring a legal gun requires strict screening, but Kalashnikovs from the Yugoslav wars are readily available on the black market. To sweeten the deal, smugglers often throw in hand grenades (there were 43 grenade incidents in Sweden last year). The victims and perpetrators of gang violence are nearly always young men.

How to explain the rise of gang violence? It cannot be the economy, which is doing well, or Sweden’s quality of life, which is among the best in the world. And crime in general is in decline. So what has gone wrong?

Some blame the refugee crisis of 2015, when Sweden took in the most asylum-seekers per capita in Europe. But shootings with illegal guns have been rising since the mid-2000s. Most gang members are indeed first- or second-generation immigrants—72% of them, according to one report, but they tend not to be new arrivals. It takes years for migrants to be settled enough to be sucked into crime, says Amir Rostami of Stockholm University. Sweden accepted lots of asylum-seekers in the 1980s and 1990s from countries like Iraq, Somalia and the former Yugoslavia.

Sweden built them homes and taught them its language, but it failed to integrate them into the labour market. The Swedish welfare system offers good education and generous benefits. But for immigrants there is little social mobility. Powerful unions insist on high wages for entry-level jobs, so firms often find it uneconomical to hire immigrants with limited education or not much Swedish. Today, 16% of people born abroad are unemployed—one of the highest rates in the OECD. Gangs offer frustrated young men an alternative. “They let you feel like a king, even if for one day,” says Mr Rostami.

Alarmed, the government has provided additional funding for integrating migrants, imposed harsher punishments for gun crimes and granted a weapons amnesty. Police have stepped up surveillance and co-operation with other European countries to curb weapons-smuggling. In January the Swedish government set up a centre to combat violent extremism.

Still, witnesses are scared to talk and the police are stretched. Not one firearm-homicide case in Stockholm was solved in 2016. The government hopes to turn that around: police wages have been bumped up, and officers who left during a reorganisation three years ago (which coincided with a rise in crime) have been re-hired. Preliminary results for 2017 show that the clear-up rate for firearm murders has risen to a (still woeful) 30% in Stockholm. But over 100 cases remain unsolved.

Swedish politicians can no longer ignore the problem, especially so close to an election in September. Carolina Sinisalo has toured Sweden to raise awareness of gun violence. She says she thinks about moving elsewhere every day, “but this was Robin’s home. I can’t leave”.