A scientist’s life usually runs within pretty normal borders, similar to most people’s. But I have spent much of the past two decades in something that feels like a dream from which I expected to wake up, because the events I experienced seemed too surreal to be true.

The dream, or nightmare, ended for me last week — hopefully for good. A German federal court finally confirmed that local authorities’ long-standing refusal to allow my experiments with macaque monkeys is illegal (see Nature 506, 24–26; 2014). I hope that this will settle the issue, and that I will finally be able to concentrate on my group’s neurobiological research. My experience offers some lessons for how the public and politicians interact with scientists and their supporters.

My ordeal began in 1997, when I accepted a position as a neuroscientist at the University of Bremen, Germany. My research involves work with macaques to investigate the neuronal mechanisms that underlie visual perception and attention.

Before I started, I heard some troubling news. Opponents of animal research had paid for an advertisement in the centre of Bremen, which claimed that the university had hired me as a monkey torturer. It showed my work and home addresses and telephone numbers, and invited people to call or visit me.

The advert was the start of a highly aggressive and defamatory campaign. Strangers threatened to kill me, my wife and our three-year-old son. A university laboratory was destroyed. I was chased by an angry mob and was given police protection.

The media’s reaction quickly turned equally hostile. Rather than objective and balanced coverage, the press mostly adopted the extremist positions of opponents of animal experimentation.

The consequences did not take long to emerge: the university cancelled plans to build new laboratories to house the monkey work. I was placed instead in an old, unsuitable building that was easier to secure. My research was put on hold, because all my time went into converting this space and countering the propaganda against me.

The situation eased a little a decade or so ago, when better discussion of animal research in the national press helped to defuse the local situation, and reduced the threat of violence. But a new enemy was waiting in the wings: politics.

“Strangers threatened to kill me, my wife and our three-year-old son.”

In local election campaigns in 2007, politicians from mainstream parties vowed to terminate my research if they were elected to the state parliament of Bremen. As a member of a post-war generation deeply convinced that fundamental rights and the rule of law are essential safeguards to prevent a re-emergence of totalitarianism, in Germany and elsewhere, I was shocked to be in this position.

True to their word, politicians in the newly elected local government ignored federal law and refused to allow my neurobiological experiments with macaques. When I and others asked why the same type of experiment exploring the same type of scientific question suddenly no longer fitted the requirements of the same law, the authorities commissioned expert reports. These claimed that the macaques’ suffering had an equal severity level to situations in which, for example, animals slowly die after severe, extended illnesses.

This was obviously absurd. Our neurobiological experiments invest years of work in a single animal and depend entirely on the creature’s physical and behavioural health. Files on how the reports were prepared (made available to the court) revealed that statements from independent experts had been ignored. Instead, the reports were written by our opponents: long-standing enemies of animal experimentation, who seemed capable of diagnosing animals’ levels of suffering without ever having seen them. The authorities also chose unusual and creative ways to interpret the law — including that it could be trumped by public opinion.

With no sound biological, veterinary or legal basis for the unilateral ban on my research, I legally challenged the decision in 2008. I was always going to win: the first court (and all the rest) remarked on the illegitimacy and unlawfulness of the obviously politically motivated decisions. Yet the authorities refused to back down and dragged the case through the Bremen administrative court, the Bremen higher administrative court and, finally, the federal administrative court in Leipzig. I think they hoped that I would give up. This is where the totalitarian attitude — the fundamental lack of respect for basic rights and the law — turned the surreal episode into a frightening one.

Last week’s verdict in my favour has gone some way to restoring my faith in the judicial system and the separation of powers. My opinion of politics and the way it works remains low. I still wait for any sign that the authorities or politicians will admit that they did anything wrong or that they have gained any insight from the experience, and for any kind of attempt to repair some of the damage caused.

Despite the growing dependence of modern societies on highly specialized fields of science, it is clear from my experience and other cases that such fields, and the relatively small group of corresponding scientists, can be quickly sacrificed for the short-lived opportunistic gains of politicians and operatives in the media. Aside from the progressive ruthlessness of such actions, they clearly threaten crucial mid- and long-term goals of society.