Goslar is a gem of a town in central Germany, nestled in the slopes of the Harz mountains. It is popular with tourists, some of whom come to enjoy its cobbled streets and half-timbered architecture, others to ski or mountain bike, or to trace the footsteps of William Wordsworth who penned the beginnings of the Prelude here while homesick during a visit in the freezing winter of 1798.

Now it is becoming famous for another reason. Behind the rich culture is a town with huge problems. It is in one of the weakest economic areas of western Germany, and – like much of the country, which for years has had one of the lowest birthrates in the world – it is facing a demographic crisis. Goslar, a town of 50,000, has shrunk by 4,000 in the last decade and is currently losing as many as 1,500 to 2,000 people a year. In some parts of the town, which once thrived on silver mining and smelting as well as a spa, whole housing blocks stand empty while others have been torn down.

Its problems were only exacerbated by the end of the cold war, when it lost its status as a major garrison town close to the border with East Germany.

Oliver Junk is determined to reverse the trend. The mayor of Goslar has sparked a debate that has spread across Germany by saying he wants more immigrants to settle in the town. While other parts of Europe are shunning refugees, sometimes with great brutality, Junk is delivering an alternative message: bring on the immigrants. There cannot be enough of them, he says.

Oliver Junk, mayor of Goslar.

At a recent gathering in Jürgenohl, a suburb of Goslar, Junk tapped his feet to a song-and-dance routine being performed for him in Russian by immigrants dressed in the colourful costumes of the former Soviet bloc countries they arrived from around two decades ago. Praising their efforts at integration and thanking them for their contribution to his city, Junk recalled how Jürgenohl only exists thanks to refugees who built it up after the war.

The 39-year-old lawyer, a member of Angela Merkel’s Christian Democrats, has triggered controversy across Germany by insisting that an influx of immigrants is the best thing that could happen to his shrinking town, which took only 48 refugees last year and, so far this year, 41. “We have plenty of empty housing, and rather than see it decay we could give new homes to immigrants, helping them, and so give our town a future,” Junk said.

Some German commentators say he is a self-publicist, others that he is naive. But it is hard to ignore a man who was elected with almost 94% of the vote in 2011, and for an eight-year term. Junk says he is merely being pragmatic. This, after all, is a man who was nicknamed “Duke of Darkness” for ordering street lamps to be turned off after midnight to save money.

The far right is furious and plans to descend on Goslar on 29 August, for an anti-Junk rally under the slogan “Perspectives, not mass immigration.”

We have empty housing, and rather than see it decay we could help immigrants, and give our town a future

This year Germany is set to receive some half a million asylum seekers, although the figure is being revised all the time as the numbers arriving in Europe from Africa and the Middle East continue to soar. That is far more than any other EU country, and more than twice the number Germany took last year.

According to an allocation formula known as the Königsteiner Schlüssel, towns are allocated refugees based on population and per head tax revenues: the bigger and richer a town, the more refugees it is obliged to take, for which it is in part supported by state money. “This system is crazy, because in big cities there is often a lack of housing, while in Goslar we have the space,” said Junk, dressed in jeans, bespectacled and with salt-and-pepper hair.

A one-hour drive from Goslar lies Göttingen, the region’s economic powerhouse. There, officials are struggling to cope with the thousands of refugees it is obliged to house based on its economic strength. As elsewhere in Germany, tent cities and container villages have been springing up overnight to cope with demand. Leisure centres and schools have been converted into shelters, but when the new term starts they will no longer be available, intensifying the problem. And as winter approaches, tent cities will no longer be viable.

“It’s mad that in Göttingen they are having to build new accommodation, and are tearing their hair out as to where to put everyone, while we have empty properties and employers who are desperate for skilled workers,” Junk said.

His appeals for politicians to adopt the “Goslar Model” have so far fallen on deaf ears. “They say to me ‘rules are rules’,” said Junk. “It’s typically rigid and German, always having to work with finished concepts rather than allowing for new ideas. Anyone who tells me Germany is full up, or that we can’t afford them, I say think of our past, and of the future. Of course we can afford them – we’re a rich country, and we have a duty to help those in need.”

Germany’s current generous asylum policy is seen in part as a way of making amends for its Nazi past. And if organised properly, say experts, it would also be a practical way for Germany to deal with the blunt fact that deaths are exceeding births.

Despite arson attacks on asylum-seekers’ homes, and verbal and physical abuse of the refugees themselves, Junk is convinced that Germans are on the whole ready to help. He dismisses the derogatory comments on his Facebook site – “Doesn’t Goslar have enough problems of its own?”, or “Now my tax money is being used to finance foreign criminality” – as belonging to a minority,pointing to the armies of volunteers helping with everything from giving language lessons to newcomers to collecting food and clothing for them. “It’s not like after the war when inspectors would come and measure your living space, allocating some of it to the ethnic German refugees, and telling you to all squeeze up together,” Junk said. “No one has to suffer here. On the contrary, if we don’t take foreigners we can turn off the lights.”

Goslar charity worker Uta Liebau supports Junk’s concept, but knows that getting asylum seekers housed is only the start. “Integration is the harder task,” she says. “Group them all together in a housing block and people will be scared of them, but put them somewhere where they can be your neighbour and you can help them with their shopping, and people start to feel responsible for them.”

Liebau began working with refugees in the early 1990s during the Balkan wars when she and her radiologist husband, Till, took in a Muslim-Christian family from Bosnia. “They lived with us for three years and found work in Goslar. Despite being integrated, well liked, and with a daughter who was the best in her class and spoke fluent German, they were extradited to Bosnia after five years, and I thought then how stupid Germany was.”

Something of an immigrant herself, having left the communist East for the West in 1979, she sees what is happening now as a new chance for Germany. “After years in which the issue of immigration was seen as a threat, we’re finally recognising their value. It’s a way of making up for German history.”

Three 17-year-old men who arrived from Syria in May quickly took up places at a local secondary school and have become minor celebrities in the town. Bahi, Raman and Abdulmoeen from Aleppo are being upheld by everyone from the local paper to Junk as the role models for the way the town might function in future. They sport fashionable haircuts and wear crisply ironed shirts. They are reluctant to discuss the devastation they left behind and keener to talk about their future in Germany. “We’re not from here, but the people are treating us as if we were natives,” said Bahi in broken German. “I could imagine studying here. Though first we need to get our parents out of Syria.”

Junk hopes they will stay. “It’s not such a small chance that they’ll say, ‘This town has treated me well, I’d like to make it my home’,” he says.

It used to be common to hear Germans saying how good it was that Germany had given refugees hope and a future. It’s rather more unusual to hear a conservative mayor openly say, as Junk does: “In each of these young men and all our refugees, there’s a chance for Germany.”