He was once Sweden’s most infamous serial killer, a self-confessed cannibal who claimed to have murdered 30 people. But Sture Bergwall could soon be freed from a high-security psychiatric unit after prosecutors dropped the last charge against a man they now accept was a fantasist.

The case gripped Sweden in the 1990s, when Bergwall – then known by his alter-ago, Thomas Quick – told police tales of the dozens of people he had raped, killed and even eaten. He was eventually convicted of murdering eight people, including three children.

More than a decade later, however, Bergwall had a different story to tell: encouraged by therapists and befuddled by medication, he had invented Thomas Quick, the serial killer, as a cry for help. Without his confessions, there was little other evidence to back up the convictions, and one by one courts struck them down.

Download the new Independent Premium app Sharing the full story, not just the headlines

Today, prosecutors withdrew the final outstanding case: the murder of a 15-year-old who disappeared in northern Sweden in 1976. Although the remains of Charles Zelmanovits were not discovered until 1993 and it was impossible to determine the cause of death, Bergwall had been convicted on the strength of his testimony alone.

“That a person has been convicted of eight murders and later been declared innocent, that is unique in Swedish legal history,” said the attorney general, Anders Perklev. “It has to be considered as a big failure for the justice system.”

Psychiatric evaluators now have to decide whether to release 63-year-old Bergwall, who told the Associated Press that today’s events were “overwhelming and emotional” and he would now push for his freedom.

The case has raised questions over why courts found Bergwall guilty of eight crimes when there was no forensic evidence or witness statements to back up his stories. At the time he began confessing to grisly murders spanning decades, he had already been detained in a secure psychiatric unit for three years.

In an interview with GQ magazine published this week, he said that when he was first incarcerated for bank robbery in 1991, he was feeling lost and battling with low self-worth. “I had burned so many bridges, and I was plunged into this profound loneliness,” he said. “I wanted to be this interesting person. I didn’t want to be this grey bad person. I wanted to be something else.”

He agreed to start therapy, and as the sessions progressed Bergwall noticed that the darker his tales, the more people listened. Craving the attention, he started to open up with stories of childhood abuse and trauma.

He began to weave ever more intricate fantasies, until he finally confessed to a killing which had been dominating the Swedish media at the time: the death of 11-year-old Johan Asplund.

The confessions continued to tumble out, aided by the high doses of benzodiazepines he was on. Bergwall was eventually convicted in a series of trials between 1994 and 2001 of killing Johan, Charles, a nine-year-old girl, a Dutch couple, an Israeli student and two women in Oslo.