“WITH the strongest weapons in the world—freedom of speech and democracy—we are staking out the course for Norway after 22 July 2011.” Jens Stoltenberg, Norway's prime minister, echoed the sentiments of most of his compatriots when he spoke at a vigil in Oslo this week. Anders Behring Breivik, a 32-year-old Norwegian and far-right Islamophobe, had admitted killing at least 76 people in a bomb attack on government buildings in the capital and a machinegun massacre on nearby Utoya island, where young members of the Labour Party were at a holiday camp.

The public's resolve to preserve Norway's cherished freedom, openness and tolerance was as striking as the grief. In Oslo 150,000 people held roses in a mass symbol of remembrance. The gesture was replicated in town gatherings the length and breadth of the country, from Svalbard, halfway to the north pole, to villages on its southern shores. “I am infinitely grateful to be living in a country where, at a critical time, people take to the streets with flowers and candles,” said Mr Stoltenberg.

Mr Breivik is in police custody, in solitary confinement without access to news or the internet for the next eight weeks. Though he has confessed to the killings, he denies he committed a crime. He will probably be charged under a recent terrorism provision in the criminal code that allows a 30-year prison sentence. There are other provisions that could keep him locked up for the rest of his life. The Norwegian police have yet to answer conclusively the vital question of whether he acted alone or with accomplices.

A facet of Norwegian openness—its tolerance of diversity—was one of the things that fuelled Mr Breivik's mass slaughter. The Labour Party, the dominant force in Norwegian politics for decades, came into his cross-hairs because of its staunch defence of both diversity and tolerance. AUF, the party youth wing that organised the camp on Utoya island, was a doubly attractive target in his twisted ideology: it is fervently anti-racist and many members come from Norway's ethnic minorities.

“Our organisation has been struck in the heart with the murder of the new young generation of politicians. It is not just an attack on the Labour Party but on the whole of Norway and on our democracy,” said Raymond Johansen, the party secretary. Gro Harlem Brundtland, a former long-standing prime minister, delivered a keynote address to the young party members on the day of the massacre. Though she had been specifically picked by Mr Breivik (who called her the murderer rather than the mother of the nation), she had fortunately left the island before he got there. Much later she revealed that she had chatted on the day to half a dozen youngsters who told her of their plans to stand for parliament in the 2013 general election. At least two of these, she said, were among the dead.

The cold-blooded targeting of the stars of Norway's political future shocked politicians of every hue. For the time being they are standing together in disgust, everyday differences cast aside. Though campaigning for local elections on September 12th was due to start soon, the parties agreed unanimously to postpone all pre-election debate until the second half of August.

One thing that stands out is Norway's determination not to let Mr Breivik's appalling deeds affect its unusual way of life. The country's easy informality and open-access attitudes can surprise foreigners used to more strictly controlled environments. After the attack the police temporarily stepped-up their vigilance at the borders, checking the identity of some, but far from all, travellers. The Royal Palace shut briefly but four days later it was business as usual, with Norwegians and tourists milling around the forecourt.

Leading figures do have security guards but very discreet ones. Crown Princess Mette-Marit, for instance, moved freely among mourners at a gathering in the home town of her step-brother, Trond Berntsen, who was on guard at the Labour Party youth camp on Utoya island and one of the first to be killed.

Just before he went on his killing spree, Mr Breivik published a 1,500-page manifesto on the internet. In graphic detail, the murderer cast himself as a latter-day crusader who would redeem European civilisation from invasion by Muslim hordes.

But Mr Breivik's declamation of invaders who are conquering by reproduction is at odds with reality. The country's demographic make-up has shifted over the past 30 years; 12.2% of its 4.9m people are now immigrants and their Norwegian-born children. But this figure covers migrants from all countries, and some 40% of them are from the West. By nationality, the biggest group of immigrants are Poles, followed by Swedes and then Pakistanis.

Moreover, Mr Breivik's prophecies of conquest by multiplying is confounded by rapidly falling immigrant birth rates. Statistics show that newcomers from countries that are culturally attuned to having lots of children quickly fall into line with Norwegian norms once residency is established.

More policemen in future? That does not mean that Norwegian immigration policy is trouble-free: there has been friction at many levels. The failure (so far) of the Norwegian authorities to expel Mullah Krekar, a fractious Islamic cleric, has caused agitation. Mr Krekar, who came to Norway as a refugee, is wanted for murder in Iraq and was deemed “a threat to national security” by the Norwegian high court. There has also been violence between various ethnic groups, but the only serious incident in recent years was the stabbing to death of Benjamin Hermansen, a boy of mixed Norwegian-Ghanaian parentage, by a neo-Nazi gang. Unemployment is higher and poverty greater among non-Western immigrants, but most charts show things moving, rather rapidly, in a fairer direction. Mr Stoltenberg this week announced an independent inquiry into the attacks, amid criticism of the police response. In thinking about the future, Norwegians may look to their immediate neighbours, examining their experiences of sudden bloodshed and the paths they took afterwards. In Sweden the murder in 2003 of the country's popular foreign minister, Anna Lindh, in the middle of a euro referendum campaign caused much revulsion and soul-searching. Though Sweden did not completely roll back its Norwegian-style openness, security has certainly been ratcheted up several notches. Sightings of leading politicians on Stockholm's streets are rarer than they once were and access to government buildings is trickier. Things have changed in Denmark too. The shock-factor here was the 2005 publication of a series of satirical cartoons of the prophet Muhammad and the threats that ensued. Protests at perceived blasphemy erupted throughout the Muslim world. Embassies were burned and scores of people lost their lives. Since then, increasingly vociferous outbursts against the ills of immigration have become commonplace—and toxic. Denmark's anti-immigration measures have been tightened incrementally and are now among Europe's most restrictive. The far-right Danish People's Party has consistently and successfully bartered its voting power for the chance to hold sway over immigration policy. Now, after Norway's tragedy, there may be some rethinking in Denmark. People are asking whether the often poisonous nature of public discourse on Islam and immigration did indeed nourish the ideology that underlay Mr Breivik's crime.

It was not like that in Norway, but it is Norway that has been hit. As bodies of teenagers still lie deep in the lake around Utoya, awaiting discovery, nobody is yet making decisions about the future. “We are broken-hearted, but we are not broken,” explained the prime minister.