Barack Obama and David Cameron met for talks at the White House yesterday, with the US President suggesting there may be a better "way through" for the case of hacker Gary McKinnon.

Following the meeting, Cameron also spoke on the matter, telling BBC Radio Five Live that the government has discussed the possibility of some of the sentence - if McKinnon were tried and found guilty - being served "in a British prison".

McKinnon, whose extradition was approved in 2006, has yet to face trial in the US. He was indicted by the District Court for the Eastern District of Virginia in 2002 for hacking into 97 military and NASA computers between February 2001 and March 2002.

His lawyers argue that his diagnosis of Asperger's syndrome, which is related to autism, make it highly unfair for him to be tried in the US where he could face a lengthy sentence in a maximum security prison.

McKinnon, who went by the name "Solo," contends he was merely searching for proof of the existence UFOs and did not harm the systems he is accused of hacking. The US military alleges that McKinnon deleted critical files from its computers, which hampered its efforts after the 11 September terrorist attacks.

US presidents do no normally involve themselves in extradition matters, Obama has said. But yesterday he vowed that US legal officials would be in touch with British counterparts in order to see if they could find an "appropriate solution".

"I trust that this will get resolved in a way that underscores the seriousness of the issue, but also underscores the fact that we work together and we can find an appropriate solution," Obama said, according to a transcript.

Cameron, who voiced support for McKinnon's case last year along with deputy prime minister Nick Clegg, said discussions with the US are ongoing and that he did not want to prejudice the case.

"We completely understand that Gary McKinnon stands accused of a very important and significant crime in terms of hacking into vital databases," Cameron said. "And nobody denies that is an important crime that has to be considered. But I have had conversations with the US ambassador, as well as raising it today with the President, about this issue, and I hope a way through can be found."

McKinnon's case has raised questions about the US-UK extradition treaty, which some argue is lopsided and makes it easier for the US to gain custody of suspects than for the UK.

In May, Home Secretary Theresa May adjourned a judicial review of McKinnon's case due to take place in the High Court. The Home Office is still reviewing McKinnon's case, a spokesman said on Wednesday.