AMSTERDAM—Organized crime used to be considered a remote threat in much of Western Europe, but ruthless violence by criminal gangs is now rattling the peace in some of the world’s safest societies.

Sweden now has Europe’s highest gun-homicide rate , and the military is helping police fight street gangs. In Denmark, residents of the commune Christiania shut their famed open-air cannabis market after violent gangs took over . In Belgium, armed security forces have started guarding customs trucks carrying seized cocaine to prevent criminals from stealing it back.

One of the most alarming exhibits of what the 21st-century drug trade has wrought upon long-peaceful European societies came earlier this year in the Netherlands, long known for its tolerant attitude toward recreational drugs.

Dutch drug kingpin Ridouan Taghi was considered so dangerous that he was tried in a warehouse-turned-bunker in Amsterdam, guarded by hundreds of masked special forces and drones circling overhead to prevent a prison break. When the judges pronounced him guilty of involvement in five murders and two attempted killings, their faces were hidden and their names weren’t revealed.

“He has managed to strike fear in the minds of people,” said Dutch lawmaker Ulysse Ellian about Taghi, who was sentenced to life in prison.

During the six-year legal proceeding that led to Taghi’s conviction, three people linked to the state’s star witness were shot dead in the streets of Amsterdam: his brother, his lawyer and a well-known crime journalist who had joined the witness’s legal team.

“We have seen murders before. What’s new about Taghi is that he also targets individuals who are not part of the criminal underworld: the brother of the star witness, a lawyer, a journalist,” said Robby Roks, associate professor of criminology at the Erasmus School of Law in Rotterdam. The case, he said, “raises all these questions about what these criminals with seemingly unlimited resources can do from prison.”

Late last month, Taghi’s 23-year-old son, Faissal, was extradited from the United Arab Emirates at the request of Dutch authorities on suspicions of participating in a criminal organization involved in international drug trafficking, money laundering and preparing violent crimes. He is now locked up in the same maximum-security prison as his father.

Ellian, a newly elected member of parliament, is pressing for dangerous prisoners to be cut off from other inmates and people outside. Without fast action “we’re taking huge risks,” he said. “The more of these top guys you arrest, the more urgent it becomes.”

recent report by Europol , the law enforcement arm of the European Union, and EMCDDA, the EU’s drug agency, said several European countries are suffering “unprecedented levels of drug market-related violence, including killings, torture, kidnappings and intimidation.” The report identified 821 serious criminal networks active in the EU, with more than 25,000 members.

The EU now considers organized crime a threat to European societies on par with terrorism.

“Violence is destabilizing society and the social contract we have known,” said Europol deputy spokesperson Claire Georges. “It used to be more at transit points, such as airports, and among specific groups. Now, violence is increasingly spilling onto the streets with the risk of civilians being hurt.”

Europol attributes the violence to a globalization of the drug trade, a surge in coca cultivation in Colombia and a fragmentation of the supply chain. Gangs have established a firmer foothold in large European ports, including Rotterdam in the Netherlands and Antwerp-Bruges in Belgium.

In 2019, cocaine seizures in Europe exceeded those in North America for the first time, according to the United Nations Office on Drugs and Crime. In 2021, the most recent year for which data is available, EU authorities seized more than 300 tons of cocaine, a record.

The kingpin

Taghi, who is 46, was born in Morocco and moved to the Netherlands, near Utrecht, as a young child . As a teenager, he joined a gang operating in local shopping malls, according to Dutch news reports and a documentary about his life. In the early 2000s, Taghi split his time between Dubai and Morocco, smuggling hashish into the Netherlands, according to the news reports.

Rising cocaine consumption in Europe prompted South American cartels to begin pivoting to that market around 2008, and Taghi entered the global cocaine trade. At one point, his gang imported about one-third of all cocaine going into the Netherlands, according to police documents cited in Dutch news reports.

The Dutch economy has long depended on international commerce, and the Port of Rotterdam is Europe’s largest. “Everything that makes the Netherlands attractive for the legal economy also makes it attractive for the illegal economy,” said Pieter Tops, professor emeritus at Leiden University and author of several books on the societal effects of organized crime.

Since the 1970s, lax and contradictory drug laws have nurtured a criminal underworld. Recreational use of cannabis is legal, but production isn’t. That opened a door for organized crime groups to supply Dutch “coffee shops.” Gangs expanded to trafficking cocaine and producing synthetics such as ecstasy, said Stijn Hoorens, director of the Rand think tank’s Netherlands office and drug-policy expert.

Dutch prosecutors say the killings Taghi was convicted of began in 2015 when he ordered the murder of a spy-shop owner who had given police his transaction records, including about surveillance equipment sold to his gang. A crime blogger who had published Taghi’s name was shot dead outside a sex club north of Amsterdam, though a court later found insufficient evidence that Taghi was behind the murder.

In 2016, Taghi relocated to Dubai using a Dutch passport with a fake name, according to Emirati police. He stayed out of reach of Dutch authorities while conducting business in Europe.

Then he was betrayed. In 2017, a murder in Utrecht that Dutch prosecutors said Taghi ordered went wrong, when the hit men killed the wrong person. The middleman who arranged the killing turned himself in to Dutch police and offered to testify against Taghi.

Dutch authorities charged Taghi in absentia with collusion in six murders and more than a dozen planned killings and hit operations, and began pretrial sessions that would extend over several years.

One state witness, the middleman referred to as Nabil B., paid a price for betraying Taghi. In 2018, his brother was shot dead outside his office in Amsterdam. The following year, Nabil B.’s lawyer, Derk Wiersum, was killed by a hoodie-clad man who fled on foot.

There were other shocking stories of violent crime. In 2016, the decapitated head of a gang member was found looking in through the window of an Amsterdam cafe. In 2020, police discovered shipping containers converted into what appeared to be soundproof torture chambers equipped with pliers, blowtorches and a dentist’s chair with shackles.

In 2019, Dubai police arrested Taghi following a manhunt and deported him to the Netherlands. On his encrypted BlackBerry, police found pictures of a woman being tortured.

Taghi was confined to a Dutch maximum-security prison during the legal proceedings. In 2021, the country’s best-known crime reporter, Peter de Vries, who had joined the prosecution witness’s legal team, was shot dead leaving a television studio in Amsterdam.

Taghi’s first lawyer was arrested after a police investigation found that the two used meetings intended to prepare for trial to discuss prison break plans. One scenario involved mercenaries shooting Taghi’s way out of prison, “the Navy Seals way,” according to an intercepted note. Taghi’s second lawyer was arrested on allegations that she had passed messages to people outside.

During the trial, Dutch authorities worried that Taghi’s men might try to break him out of prison by kidnapping prison staff and forcing an exchange. Dutch Prime Minister Mark Rutte stopped riding his bicycle to work, and Dutch Crown Princess Amalia canceled her first year of university—both apparently due to kidnapping threats from Taghi. The threats were disclosed in a court case against his cousin, who had been arrested while acting as his lawyer.

A survey last year showed that half of all Dutch judges and prosecutors felt less safe in their work due to threats or intimidation, and that nearly one-third of them had changed their work routines, including by replacing their name on case files with a code.

The lawmaker

Ellian, a 35-year-old Afghan-born member of parliament, said he first came across Taghi in 2018. Then a member of a municipal council, Ellian publicly accused Iran of ordering the 2015 murder of an Iranian dissident in his town. The man convicted of arranging the murder, Naoufal Fassih, was a hit man for Taghi, according to the indictment. Through a lawyer Fassih filed a disciplinary complaint against Ellian.

The implicit message, Ellian said, was: “We’re watching you. Stop talking.”

Dutch lawmaker Ulysse Ellian is pressing for restrictions on high-risk detainees. Photo: Marjon Hoogervorst for WSJ

Ellian launched a political career by pledging to confront Taghi and other dangerous prisoners who he has said threaten the country’s democracy.

In 2021, as a newly elected center-right member of parliament, he traveled to the onetime Mafia hotbed of Palermo, in Sicily, to learn about the Article 41-bis regime, which since the early 90s has allowed the Italian government to impose the near-complete isolation of a prisoner.

He toured the Colorado prison housing Mexican drug lord Joaquín “El Chapo” Guzmán, who recently complained to authorities that he hadn’t been allowed to speak to his wife and daughters for seven months.

Ellian wants the Netherlands to implement a similar system—something as harsh as possible under European human-rights law.

The Dutch Parliament is set to debate a bill he proposed to restrict high-risk detainees to two phone calls and one visit a month. In June, he succeeded in allocating about $33 million to expand the country’s maximum-security prison by another 12 cells.

Fearing retaliation from Taghi’s gang, Ellian receives police protection from the unit that protects the Dutch royal family.

“It’s not personal,” he said. “Although for Taghi, it might be.” He spoke during a drive home from parliament with the siren on his government car blasting as the bodyguard-driver blew through red lights. Next to the driver sat a second armed guard in body armor.

Last year, Ellian accompanied prison staffers in the city of Roermond on a night raid to confiscate phones. His face covered by a balaclava, he followed prison guards as they threw open cell doors and used dogs to find hidden phones.

His efforts have drawn the attention of inmates. Walking through a Dutch prison recently, a prisoner barked out his name. On another visit Ellian said, an inmate called out, “Why are you always trying to make things harder for us?”

In public court sessions, Taghi has criticized Ellian for abusing his political power to restrict the rights of prisoners.

“We Europeans take freedom and living in a secure country for granted,” Ellian said. “But you have to stand up for it. A free country can change into something ugly very fast.”

Write to Sune Engel Rasmussen at sune.rasmussen@wsj.com