The left, which dominated Swedish politics for decades and devised the cradle-to-grave welfare system, has blamed reduced state benefits and a modest shift toward the privatization of public services for the unrest, pointing to an erosion of the country’s tolerant, egalitarian ethos. A recent report by the Organization for Economic Cooperation and Development said that income inequality had grown faster in Sweden than in any other industrialized nation between 1985 and the end of the past decade, although it remains far more equal than most countries.

“The rich are getting richer, and the poor are getting poorer,” said Barbro Sorman, an activist of the opposition Left Party. “Sweden is starting to look like the U.S.A.”

But Stockholm’s immigrant enclaves, including Tensta and the nearby suburb of Husby, where the riots began May 19 after the police fatally shot a 69-year-old immigrant wielding a knife, show few outward signs of deprivation.

Created in the 1960s as part of a state building blitz to create a million new homes in a decade, Stockholm’s northern suburbs now offer well-tended parks, graceless but well-maintained public housing, well-equipped schools, youth centers, libraries and legions of social workers financed by the state.

Dejan Stankovic, the Serbian-born manager of a team of government youth workers that has joined parents and other volunteers on nightly street patrols, recalled a visit to the area by a group of mystified American social workers. “They said, ‘It is green and safe, so what is the problem?’ ”

One big problem is the lack of jobs. The national unemployment rate is about 8 percent, but the rate is at least twice as high in immigrant areas and four times as high for those under 25. But, said Nima Sanandaji, a Kurdish-Swedish author of several books on immigration who was born in Iran, remote areas in the north of Sweden have more people out of work, “but they are not throwing rocks and burning cars.”

Mr. Stankovic said he was sympathetic to immigrants’ complaints of discrimination in the job market. But, he added, many job seekers, particularly young men, had unrealistic demands and expected the state to find them work in their own neighborhoods. “There are a lot of people aged from 20 to 22 who say, ‘I want a job, I want it now, and I want to stay here,’ ” he said. “This is their problem, but it becomes a government problem.”