A British academic who was accused of spying for the UK government in the United Arab Emirates after travelling to Dubai to conduct research has been sentenced to life in jail.

Matthew Hedges, 31, has been in a UAE prison for more than six months. The University of Durham PhD candidate went to the country to research his thesis and was sentenced at an Abu Dhabi court on Wednesday in a hearing that lasted less than five minutes, with no lawyer present.

His wife, Daniela Tejada, 27, who was present in the courtroom, said Hedges began shaking when the verdict was read out.

“I am in complete shock and I don’t know what to do,” she said. “Matthew is innocent. The Foreign Office know this and have made it clear to the UAE authorities that Matthew is not a spy for them.”

She said the case had been handled “appallingly” with no one taking it seriously.

“The British government must take a stand now for Matthew, one of their citizens,” she said. “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.”

Hedges was detained on 5 May at Dubai airport as he was leaving the country.

He was arrested after an Emirati man apparently reported him to the authorities for “asking sensitive questions about some sensitive departments” and “seeking to gather classified information on the UAE”.

Hedges’ family said he had all the correct documentation in order to enter the UAE and was researching aspects of the UAE’s foreign and domestic security strategy, including the war in Yemen.

However, the UAE’s attorney general, Hamad al-Shamsi, said in a statement to the official news agency WAM that Hedges had confessed to the charges against him. There is no independent confirmation of this claim. Hedges was taken to court in Abu Dhabi twice in October, with the case being adjourned both times.

It was only after his third court appearance that he was allowed any legal representation.

Shamsi said Hedges was accused of “spying for a foreign country, jeopardising the military, political and economic security of the state”.

He added that the ruling “was not final” as Hedges has the right to appeal against the verdict before the federal supreme court.

Hedges has denied the charges, and maintains he was in the country to research the impact of the Arab spring on the UAE’s foreign policy.

Tejada boarded a plane to the UK on Wednesday where she was due to meet with the British foreign secretary, Jeremy Hunt, on Thursday to discuss the case.

Hunt tweeted on Wednesday:

Jeremy Hunt (@Jeremy_Hunt) News on Matthew Hedges extremely worrying. We have seen no evidence to back up charges against him. FCO will do ALL we can to get him home & I will meet his wife Daniela tmrw. UAE claim to be friend & ally of the UK so there will be serious diplomatic consequences. Unacceptable.

At prime minister’s questions in the Commons on Wednesday, Theresa May said she was “deeply disappointed and concerned” about the case and would be raising it with the Emirati authorities.

“The Foreign Office will remain in close contact with Matthew, his family and his lawyer,” she told MPs. “We will continue to do all we can to support them as they consider the next steps and we will continue to press this matter at the highest level with the Emiratis.”

The angry British reaction to the sentence places Hunt, a relatively inexperienced foreign secretary, at odds on human rights issues with three of the most powerful countries in the Middle East – Iran, Saudi Arabia and the United Arab Emirates.

Hunt placed the case of Nazanin Zaghari-Ratcliffe at the heart of his visit to Iran this week. He is also privately appalled by Donald Trump’s decision to give a free pass to the murder of Jamal Khashoggi, endorsed or covered up by the Saudi Crown Prince Mohammed bin Salman.

Few in the Foreign Office expected Hedges – at worst naïve, and at best innocent – to be given a life sentence for trying to carry out academic research into the UAE’s security politics.

The UAE for its part insists that when being cross-examined Hedges had pleaded guilty to all the charges laid against him. But there have been questions over the value of any confession given after many months in detention, largely in isolation.

Diplomatic relations between the UK and UAE are generally warm, and Hunt raised the Hedges case when he was in Dubai last week. The UAE’s foreign minister, Anwar Gargash, is a frequent and eloquent exponent of his country’s position during frequent visits to London, and he is widely respected.

But he has been one of the most staunch defenders of the UAE judiciary in this case, claiming that as a result of their investigations “unusual and embarrassing revelations about friends and allies had come to light”.

The UK will hope that the courts would relent on appeal, but for Hunt this is likely to be a test case if he is not released. He knows he is taking a risk by highlighting human rights cases, but feels determined to put ethics alongside commerce.

Hedges, who is originally from Exeter, had been in the country for two weeks when he was arrested.

His family have said he spent more than five and a half months in solitary confinement after his arrest, with no indication of the reason for his detention.

Tejada said that during the first six weeks he was interrogated without a lawyer or consular access, and held in “inhuman” conditions under which his mental health deteriorated. During this time he was allegedly made to sign a document in Arabic which it has now been disclosed was a confession statement. Hedges does not speak or read Arabic.

Prof John Williams, the head of the University of Durham’s school of government and international affairs where Hedges has been studying for his PhD, told the BBC: “We’re desperately worried about Matt’s welfare. He’s an innocent man – he’s been subjected to a terrible period of detention. The process of the trial has lacked any legitimacy or credibility, and his health is not good … We all hope, above everything else, that he will be home very soon.”

Hedges’ friend and fellow academic Cinzia Bianco told the Guardian he had chosen to study the UAE because he had spent part of his childhood in the country and his father still lived there.

She said: “Matthew considered the UAE even safer and closer to him because he has personal connections out there, so this has been incredibly shocking.

“We are even more outraged because this could happen to any of us. It could happen to me next month when I am conducting my own field work.”

She explained that Hedges would have had an initial contact in the UAE and would have made more connections during his work.

“You never know who you are going to speak to when you go out,” she said. “It is more of a connection on the ground and it leads to other people so you can’t get approval for every person that you are going to meet.”

Hedges has 30 days to appeal against the verdict.