The pace of the neighbourhood watch suddenly picks up. "Here's the fire we've been waiting for," grins Samiy, an Iraqi in a bulky jacket.

It's half past two in the morning and Samiy, along with dozens of others from local Islamic groups and community organisations, has spent the night patrolling the streets of Husby, the suburb at the centre of riots in Stockholm.

Soon there's an acrid stench of burning plastic, and flickers become visible around the footbridge that the group is now jogging towards. A dumper truck on the road below is burning as a crowd of young men look on. Most claim to be watchmen, but as soon as a fire engine arrives, 10 or more rush to the bridge and begin pelting a firefighter who runs up.

"It's enough. It's enough," cries Jamil Hakim, from a group called Safe Husby. "Two nights was fun. But it's enough. It's not fun any more."

The crowd turns to see a phalanx of police in full riot gear marching up a ramp to the bridge, protected by a wall of transparent shields. Immediately, the stone throwers – most barely more than children – sprint into the darkness, while Hakim confronts the police. "Get lost! Please, just disappear," he says.

By Saturday morning, the usually calm Swedish capital city had been rocked by six nights of disorder, with up to 200 cars set ablaze, fires in schools, police stations and restaurants, and about a dozen police officers injured. Police estimate that more than 300 young people have been directly involved, of whom 30 have been arrested.

What began in Husby last Sunday has spread to more than a dozen of the city's other suburbs. And on Friday night, while police reported a quieter night in the capital, fires and stone-throwing were also reported in Uppsala, Södertälje, and even further afield in Linköping and Örebro, in central Sweden.

The morning after the truck-burning, however, Husby seems idyllic. There's a busy vegetable stall in the main square and a group of elderly men sipping beer in the sun. The rows of seven-storey blocks, built in the 1960s and 1970s as part of Sweden's "million homes" project, are all freshly painted, the gardens and playgrounds well-tended. At the local school, the windows broken the previous night are already being fixed.

"If you have broken windows and they see it, they will crack other windows, so we must fix it immediately," says Christer Svensson, who has come in to do the work. "I don't care, I make money out of this."

Outside the new library, which opened last month, another handyman is busy painting. "This place behind me, they've just spent 40m kronor [£4m] on it," he grumbles. "They don't talk about that when they talk to the TV, do they? They talk about the problems; they don't talk about everything people are doing for them.

"These people, they should integrate in this society and just try a little bit more to be like Swedish citizens."

Scratch beneath the surface and this is a sentiment shared by many in a country that arguably has the world's most generous asylum policies. Sweden has taken in more than 11,000 refugees from Syria since 2012, more per head than any other European country, and it has absorbed more than 100,000 Iraqis and 40,000 Somalis over the past two decades. About 1.8 million of its 9.5 million people are first- or second-generation immigrants.

"This is one of the countries that treats immigrants the best," says Mohammed Hassan, a Bangladeshi studying in Husby's new library, who previously lived in Brick Lane in east London. "It's much, much better than any other European country in which I've travelled."

So it has come as a shock for many Swedes to discover the scale of resentment. It's not hard to find it. Aleks, whose parents came from Kosovo, says: "I hate the police. I hate the cops. I think setting fire to cars in the neighbourhood should stop, but I don't think throwing rocks at the cops should stop."

The trigger for the riots – police shooting dead a 69-year-old Portuguese man called Lenine Relvas-Martins – has been dismissed as an excuse. But his neighbours are still incensed. "They had a bastard-load of police here. You would have thought there was a huge group of terrorists, not a man with a little knife," complains Milos, 73, Relvas-Martins's neighbour since 1984. "If he was Swedish they never would have shot him. I'm sure about that."

Martins had been brandishing a knife on his balcony, angry after a confrontation with local youths. Police then broke into his house and shot him in front of his Finnish wife. They say she was at risk. She denies it.

The police then inflamed the situation last Sunday, reportedly calling young people causing a disturbance "monkeys" and "negroes".

"They seize people, and strip them and really embarrass them in front of their friends," complains Yusuf, a young Somali. Yusuf used to live in Birmingham, but says he prefers Husby. And there's no doubt Husby has better facilities than deprived areas in Britain. But it is also more segregated. About 85% of people here have their origins outside Sweden.

"The politicians are thinking the wrong way. They want to help people, but you never help people when you put 30,000 to 50,000 in one place," complains the man painting at the library.

Camila Salazar, who works for Fryshuset, a Stockholm youth organisation, says: "For a lot of people who live in segregated areas, the only Swedes they meet are social workers or police officers. It's amazing how many have never had a Swedish friend."

A third of the 2,500 white, ethnic Swedes who lived in Husby 10 years ago have left. "My children say: 'Why don't you leave there? All the Swedish have gone,'" complains Milos. "There's only three Swedish families left in this whole block."

Inequality has also grown faster in Sweden over the past decade than in any other developed country, according to thinktank the OECD, which puts the blame partly on tax cuts paid for by reductions in welfare spending.

According to official statistics, more than 10% of those aged 25 to 55 in Husby are unemployed, compared with 3.5% in Stockholm as a whole. Those that do have jobs earn 40% less than the city average. But Aleksandar-Pal Sakala, an IT consultant and politician for the centre-right Moderate party, has little sympathy. "It's nonsense, this leftwing propaganda that the schools are bad and there's no jobs. Some people are too lazy. They feel they have less respect if they work in a low-status job," he says. "When I came here from Belgrade, I was cleaning. I worked 12 hours a day, seven days a week."

Kista, only 20 minutes' walk away, is Sweden's Silicon Valley, with more than 20,000 people working in IT, but Sakala says most Husby people can work only in Kista's giant shopping centre. "Many people living in the area are not qualified for IT jobs."

More than a quarter of Husby's adult population has only GCSE-equivalent education, compared with a tenth for Stockholm as a whole, and only a third have any further education.

However, Esmail Jamshidi, a 23-year-old medical student born and educated in Husby, says young people don't lack opportunities.

"It's a very recent development, this ghetto mentality," he says. "Immigrants come here, and most leave after a decade or two. A very small percentage of them don't, and this last group are left. And then the next war erupts and another group of people come, and, again, the vast majority make it. What we see now is the kid brothers of those who got stuck here, and now there are so many of them that it's starting to be a problem."

The older generation of immigrants seems as puzzled by the anger as Swedes. Ali, the owner of Café Unic, a Persian cafe in Husby's main square, says he tried living in America but came back. "I love this country. I mean it," he says. "I'm telling my kids every day to remember that you are born here, in Sweden. I love this country because of the way they built it: because of my taxes, and other people's taxes, everyone has a nice place to live. It's a very, very nice and good idea."