Abu Dhabi, United Arab Emirates (CNN) A British academic accused of spying was sentenced to life in prison in the United Arab Emirates after a five-minute hearing in which he was not represented by a lawyer, his family said, prompting outrage from politicians in London.

Matthew Hedges, a specialist in Middle Eastern studies at Durham University in England, was arrested on May 5 by UAE officials as he was leaving Dubai airport after a research trip. Accused of espionage, the 31-year-old was held in solitary confinement for almost six months. But he was released on bail last month.

A family spokeswoman said Hedges was forced to sign a confession in Arabic, a language Hedges does not read or speak.

Britain has warned of "serious diplomatic consequences" for the UAE's imprisonment of Hedges and could threaten to derail relations between the two countries.

Ben Bradshaw, the member of Parliament who represents Hedges' constituency, told CNN he was "completely horrified" by the decision. Bradshaw said the British government and Durham University have assured UAE authorities that Hedges is not a spy.

"This is totally unacceptable for a friendly government like the UAE to treat a British citizen in this way," Bradshaw said.

"The British government needs to make quite clear to the Emiratis that should any harm come to Matthew for any reason, that they will bear full responsibility for that."

Hedges' sentence on Wednesday appeared to come as a surprise to British authorities. UK Foreign Secretary Jeremy Hunt said the verdict was not what the UK "expected from a friend and trusted partner of the United Kingdom" and that it was "contrary to earlier assurances."

Hedges' wife, Daniela Tejada, said that the past six months have been the "worst" of her life.

Hunt said in a statement he was "deeply shocked and disappointed" by the verdict. "I have repeatedly made clear that the handling of this case by the UAE authorities will have repercussions for the relationship between our two countries, which has to be built on trust," he said.

"I regret the fact that we have reached this position and I urge the UAE to reconsider."

British Prime Minister Theresa May told the UK Parliament she was "deeply disappointed and concerned" at the verdict.

"We are raising it with the Emirati authorities at the highest level," she added.

Wife distraught

Hedges' wife, Daniela Tejada -- who was present at the hearing -- said she was in "complete shock" and that her husband was "shaking when he heard the verdict."

She was deeply critical of the British handling of the case, insisting that Hedges is innocent.

"The Foreign Office know this and have made it clear to the UAE authorities that Matthew is not a spy for them," Tejada said. "This whole case has been handled appallingly from the very beginning with no one taking Matthew's case seriously."

"The British government must take a stand now for Matthew, one of their citizens. They say that the UAE is an ally, but the overwhelmingly arbitrary handling of Matt's case indicates a scarily different reality, for which Matt and I are being made to pay a devastatingly high price."

Tejada added that this has been "the worst six months" of her life. "The UAE authorities should feel ashamed for such an obvious injustice. I am very scared for Matt. I don't know where they are taking him or what will happen now. Our nightmare has gotten even worse," Tejada said.

The UAE government has not responded to a CNN request for comment.

Spying charges

The UAE attorney general, Hamad Al Shamsi, announced on October 15 that Hedges had been charged with "spying for and on behalf of a foreign state, jeopardizing the military, economy and political security of the UAE." Shamsi said Hedges had entered the UAE "under the 'cover' of academic research."

Hedges was in the UAE conducting interviews for his PhD thesis, his wife says.

According to a letter posted on Tejada's Twitter account in October, the 31-year-old had been in the UAE to conduct interviews for his Ph.D. thesis examining civil-military relations in the wake of the Arab Spring.

It is not clear whether there is a wider diplomatic context to the Hedges case, but ties between the UK and the UAE have become strained recently. The UAE and its bigger regional ally, Saudi Arabia, have led efforts to contain the spread of Islamist movements like the Muslim Brotherhood in the Middle East. To the private irritation of the UAE, London does not classify the Muslim Brotherhood as a terrorist organization, and its members are eligible for asylum in the UK if they can demonstrate evidence of persecution.

The UAE is part of the Saudi-led coalition that is fighting the Iran-backed Islamist rebels in Yemen. This week, the UK circulated a draft resolution that would call a ceasefire in the besieged port city of Hodeida.

Radha Stirling, chief executive of UK-based legal advice group Detained in Dubai, said she has seen a "growing concern" in the US and Australia "as to whether the Gulf nation is truly an ally or actually a threat to national interests."

"For the moment, the UAE consistently displays that reality is a complete contradiction to the modern image its PR companies try to push to Western tourists and investors."

Stirling said while she expects that Hedges will launch an appeal, "we must remember that he will be facing a judicial system that is known for corruption, unfair trials, forced confessions and discrimination."

She added: "The UK courts have repeatedly denied all extradition requests to the country on this basis and, in Matthew's case, the ultimate determination of his matter will come down to the ruling party, not to the legal system."

'A cocktail of medication'

The Hedges' family spokeswoman said that during his first six weeks of detention, Hedges was "interrogated without a lawyer, or consular access, and held in solitary confinement."

The spokeswoman said Hedges' health grew worse in the subsequent months. "His mental and physical health seriously deteriorated. Matt was fed a cocktail of medication by the prison guards including Xanax, Valium and Ritalin," she said. "After four months of solitary confinement he began vomiting on a daily basis."

Tomorrow, Nov 21, Matt will be appearing in court in Abu Dhabi. Hoping that justice will prevail and my husband will be granted his rightful freedom. #MatthewHedges pic.twitter.com/omMpJZ800B — Daniela Tejada (@dtejadav) November 20, 2018

On October 29, she said, Hedges was released with an ankle monitor and was told to stay in Dubai.

The UAE foreign ministry conducted a review of Hedges "welfare status" on October 24, it said, following reports about the 31-year-old's treatment.

Hedges was originally released on bail on October 29.

It said he had "been provided with constant medical and psychological care" and that "family members and embassy staff were given access to him."

"The treatment of Mr. Hedges is entirely in keeping with obligations under UAE law and international norms and Mr. Hedges' welfare has been appropriately supported and maintained throughout the process," the foreign ministry added.

"Since the commencement of the trial, as per UAE law, the conditions of Mr. Hedges' remand have been reduced."