British academic Matthew Hedges, who has been jailed for spying in the UAE, is seen in this undated selfie photo with his wife Daniela Tejada whilst on holiday in Thailand, supplied by his wife Daniela Tejada. Photo supplied on November 23, 2018. Daniele Tajada/Handout via REUTERS

LONDON (Reuters) - Britain said it was grateful to the United Arab Emirates on Monday after it pardoned a British academic jailed on spying charges.

The UAE said it had pardoned Matthew Hedges just minutes after showing a video of him purportedly confessing to being a member of Britain’s intelligence agency MI6. Britain has denied he was a spy.

“Fantastic news about Matthew Hedges,” British Foreign Secretary Jeremy Hunt said. “Although we didn’t agree with charges we are grateful to UAE government for resolving issue speedily.”

Hunt said it was also a “bittersweet moment” because he was thinking about innocent people still detained in Iran.

“Justice won’t be truly done until they too are safely home,” Hunt said.