Deputy prime minister Nick Clegg has said the government may be powerless to keep Nasa hacker Gary McKinnon in the UK, despite the Liberal Democrats' pre-election pledge to do so.

In the months leading up to the general election, Lib Dem leader Clegg said he believed legal mechanisms were in place that could allow the government to halt McKinnon's extradition to the US to face charges of hacking into military systems. However, in an interview on Radio Five on Tuesday, Clegg said the legal picture appears to be less clear than his legal advisers had made it seem.

"What I haven't got the power to do — and neither has the home secretary nor the prime minister — is to completely reverse and undo certain legal aspects of this (case)," Clegg said. "That, of course, you wouldn't want any politician to do. That's what we're looking at at the moment. It's legally very complex."

The Lib Dems also promised a Freedom Bill which would, among other things, be aimed at making changes to the UK/US extradition treaty introduced under the Labour government and which is has been criticised for a lack of reciprocity on the US side.

In the interview, Clegg said he hadn't changed his mind on the "morality and the principle" of the matter. "It would be the right thing to do to have Gary McKinnon tried in this country," he said.

McKinnon, who suffers from Asperger syndrome, hacked into 97 US military systems between 2001 and 2002 in what he claims was a search for evidence of extraterrestrial life. According to the US authorities, he caused $700,000 (£485,000) damage and should stand trial in that country. If convicted in the US, he could be sentenced to 70 years in a maximum security federal prison.

A succession of Labour home secretaries, including Jacqui Smith and Alan Johnson, refused to intervene in McKinnon's case. Johnson declined to halt the extradition despite fresh evidence of McKinnon being suicidal and on medication — a decision that was to have been reviewed by the administrative court at the Royal Courts of Justice this week.

That review was halted by new home secretary Theresa May, a Conservative, in order to carry out a re-examination of the case, following an appeal for action by McKinnon's legal team.