When a center-right politician wrote an opinion piece last month on the need to discuss a limit on refugee numbers, her party leadership said they felt “sick” and “ashamed” of her “pitiful” article. Politicians and the media dumped a truckload of scorn on a governing party lawmaker who proposed a ban on street begging last month. She had “made the mistake of listening to her constituents,” one of her few supporters, the mayor of Vaxjo, Bo Frank, wrote on his blog.

There is no evidence that opinion has shifted toward the Sweden Democrats since Mr. Reinfeldt’s speech, and social media discussion this week has been buzzing with revelations about racist comments on chat forums by far-right candidates, one of whom was photographed wearing a swastika armband. But as Election Day nears, divisions between the main parties have emerged.

The center-left Social Democrats, front-runners for the premiership, contend that Mr. Reinfeldt, even as he embraced the principle of welcoming immigrants, made a calculated gift to the far right by highlighting the cost of integrating refugees. They say his government is preparing to cling to power with the Sweden Democrats’ support.

Mr. Reinfeldt’s colleagues counter that he was simply scoring a point against the left’s promises of generous public spending. Gustav Fridolin, the Green Party leader and potential coalition partner with the Social Democrats, said he was “proud to live in a country where a center-right party during an election campaign asks for solidarity when the world is burning.”

Boel Godner, the mayor of Sodertalje, a town near Stockholm that has taken in thousands of people fleeing Iraq and where half the population has a foreign background, complained that her municipality received no additional funding from the national government, while wealthy towns received very few refugees. “We need to do more than open our hearts, it is not a solution in itself,” she said.

The Integration Ministry said financial support for towns receiving refugees was recalculated this year to make it fairer.

In Trollhattan, a town of 50,000 people near Sweden’s second city, Goteborg, almost one in four people has an immigrant background. At 13.9 percent, unemployment here is nearly twice the national average, not helped by the bankruptcy in 2011 of Saab, a premium auto manufacturer, that threw thousands of people out of work.