Well-wishers bring flowers and candles to honor the victims outside the main synagogue in Copenhagen, on February 15th. Photograph by ODD ANDERSEN/AFP/Getty

Denmark, to steal a phrase from Garrison Keillor, is my mother-in-law land (I’m married to a Dane), and Copenhagen for many years has been, after New York, my second home. When I’m there, I stay in the old city, fairly close to the canals, the main shopping street, and the government buildings familiar to anyone who watches “Borgen,” the superior Danish television series. I sometimes feel as though I know every inch of the streets where so much went bad this past weekend.

The synagogue on Krystalgade, in the center of the old city, is close to what was once the main building of the university; it crosses Fiolstræde, a street of cafés where some of the city’s few remaining antiquarian bookstores still do business. A few years ago, when Joakim Garff published “SAK,” his monumental biography of Søren Aabye Kierkegaard, I would, on breaks from reading it, bike and walk past some of the places where Kierkegaard lived—on Nørregade, close to the synagogue, the more upscale Bredgade. These excursions were always a reminder of what a small and fragile place the city was and is. I always found Danes to be unusually open with strangers; one could spend time on the narrow streets and say, in a burst of sentimental hope, that this was the sort of place that the world should aspire to be. A favorite saying in Denmark was vi har det godt—loosely translated as “life is good for us”—and so it was, despite all the complaints about high taxes and nosy bureaucrats and too many incomprehensible petty laws. (Nathan Heller wrote about those aspects of Scandinavia in The New Yorker earlier this month.)

Because life has been so kind to the Danes, they felt that it was something of duty to share it with others, and so for a while they welcomed immigrants from places where life wasn’t so good for anyone. And they watched over those who had come earlier. The Jewish population in Copenhagen is not very large—several thousand—and many are intermarried or secular, but they have been officially welcome in Denmark since the early nineteenth century. The story of how they were ferried to safety in Sweden when the Germans occupied Copenhagen and were about to pounce has often been told, and retold—a history that even with heroic embellishments is nonetheless correct in spirit.

Since what’s now called the “Mohammed crisis,” following the publication, in 2005, of provocative cartoons in the daily newspaper Jyllands-Posten, the atmosphere has changed. Danes are caught in the puzzle of trying to balance unrestricted freedom of expression with the realization that some expressions are likely to lead to violence. As a visitor in recent years, I sensed this tension, which began to deepen as Denmark enacted increasingly strict barriers on immigration; the anti-immigrant and anti-European Union Dansk Folkeparti (Danish People’s Party) now has the third-largest presence in the Folketing, the Danish parliament.

Despite all that, it was still possible to believe that Denmark’s powerful commitment to a civil society would triumph, and that is why what happened this weekend is so hard to absorb. There were two attacks, first at a café where a talk about the cartoons and free speech was interrupted by a gunman, who killed one person and wounded others, and then a few hours later just outside the synagogue, where, according to the police, the same gunman killed another man, a security guard who was Jewish. After that, the inner city went into lockdown; streets that are usually loud and lively on Saturday night had gone dark and quiet. An armed police presence, rarely seen in Copenhagen, converged on the old city, surrounding Nørreport Station—the busiest rail station in Denmark, where the Metro, the S-tog (the subway and elevated commuter network), and the regular rail service pass through, and where bicycles are stacked outside like a deranged abstract sculpture with a wheel motif. It was north of there, in the Nørrebro neighborhood, home to many immigrants, where police shot dead the alleged gunman.* According to press reports, his name was Omar Abdel Hamid El-Hussein, and he was born in Denmark.

I knew the man killed at the café. His name was Finn Nørgaard. He was one of my wife’s best friends, a talented filmmaker, an open and good-hearted man who was fascinated by the challenges that immigrants from very different cultures presented to a small country; a few years ago, they worked together on a documentary about some “new Danes,” who were trying to come to term with their lives as outsiders. His subjects were lucky, because they could not have been filmed by a more sympathetic eye.

That I would know this one person in a city of more than a million residents is actually not so strange; rather, it bespeaks the intimacy of a society like Denmark, where people seem uncannily tied to one another. This aspect of Danish society makes what happened all the more unsettling.

A friend said some of this in an e-mail, writing “People here are sad and angry over the growing violence in our safe and lovely land and many of us worry that our society is about to be destroyed by forces that don’t wish us well. A little while ago, we went to the synagogue to show our respect, and along the whole building people had put down flowers and small candles. It was a beautiful sight.”

*This sentence has been revised to clarify the location of the shooting.