LONDON — Julian Assange has been left in a state of "extreme stress, chronic anxiety" and "constant panic" after spending seven years holed up in London's Ecuadorian Embassy, a leading United Nations expert who visited the WikiLeaks co-founder in prison said Thursday.

Nils Melzer, the U.N. special rapporteur on torture, told NBC News he blames the United States, United Kingdom and Sweden for "ganging up" on Assange and subjecting him to "psychological torture" and "collective persecution" while he was inside the embassy.

"You talk with him and he is extremely agitated. He had all these questions: What's going on there? What is in this [legal] proceeding? And what's going to happen here?" the U.N. official, who has been working informally with Assange's legal team, said.

"He's so preoccupied that he will bombard you with questions without waiting for answers," Melzer said.

Assange fled to the embassy in 2012 to avoid extradition to Sweden to face allegations of rape and sexual assault. Critics pointed out he was free to walk outside and face justice whenever he wanted.

But Assange and his supporters claim he was forced into exile to avoid extradition to the U.S., a belief supported by Melzer.

Assange is currently being held at London's high-security Belmarsh prison, having been hauled out of the embassy in April and sentenced to 50 weeks for skipping bail.

The U.S. has since announced it is charging Assange with 17 counts under the Espionage Act of 1917, which critics say has potential free speech implications.

In a telephone interview, Melzer said that if Assange is extradited to the U.S., he faces what amounts to "ill treatment or torture," such as prolonged isolation, sensory deprivation and solitary confinement.

He faces up to 175 years in prison if convicted of all charges.

"There is this intelligence cooperation between Sweden and the U.S., which is very important for Sweden and their own defense strategy since they evolved away from neutrality in the '90s," Melzer said. "Sweden has been very forthcoming in cooperating with the U.S. in those years."

Asked by NBC News to respond to the allegation that its investigation of Assange was disproportionate, the Swedish prosecutor's office declined to comment.

The investigation of sexual assault against Assange expired in 2015 because it exceeded the statute of limitations. The investigation of rape was dropped in 2017 because officials said it was impossible to pursue Assange while in exile. They reopened that case after his arrest last month.

On Thursday, Assange missed a court hearing because his lawyer said he was too ill to appear by video link. Melzer visited him on May 9, accompanied by two medical professionals specializing in the impact of torture on detainees.

He "shows all the signs that are typical for person who has prolonged exposure to psychological torture, including extreme stress, chronic anxiety and intense psychological trauma," Melzer said. "You can see that that's someone who lives in constant panic. Basically, it's a bit like imagine being in a nightmare and never waking up."

The U.N. rapporteur is also a professor of international law at the University of Glasgow, human rights chair of the Geneva Academy of International Humanitarian Law and Human Rights, and previously worked as an adviser to the International Committee of the Red Cross.

In a U.N. statement released Friday, Melzer said he believes there has been a "unrestrained campaign of public mobbing, intimidation and defamation" by the U.S., Ecuador and Sweden to get Assange extradited to the U.S. Other experts say that Sweden's reopening of the rape case complicates this supposed aim.

Melzer has written to all four governments asking them to "refrain from further disseminating, instigating or tolerating statements or other activities prejudicial to Assange's human rights and dignity."

“In 20 years of work with victims of war, violence and political persecution, I have never seen a group of democratic states ganging up to deliberately isolate, demonize and abuse a single individual for such a long time," he wrote.