Mr Mohamed lived in London before his arrest in 2002
A British resident held at Guantanamo Bay is to be released "as soon as practical arrangements can be made", the Foreign Office has said.
Binyam Mohamed, 30, will return to the UK after more than four years at the controversial US military base in Cuba.
Foreign Secretary David Miliband said agreement had been reached between the UK and US governments on his transfer.
Mr Mohamed's lawyers say he poses no risk to the UK, but it is not clear if he will be allowed to stay in Britain.
BBC world affairs correspondent Allan Little said that although Mr Mohamed's legal team did not expect him to be arrested or detained by British authorities, his immigration status in the UK remained "very much under review".
The Ethiopian-born detainee has been held at Guantanamo since September 2004 after his arrest in Pakistan.
The US accused him of involvement in a plot to detonate a "dirty bomb" in America, but all charges against him were dropped.
Mr Mohamed claims he was tortured into falsely confessing to terrorism and alleges MI5 officers were complicit in his abuse.
The attorney general is consulting the director of public prosecutions over whether to order a criminal investigation into Mr Mohamed's torture claims.
He alleges he was secretly flown from Pakistan to Morocco and tortured before being moved to Afghanistan and on to Guantanamo Bay.
Earlier this year he went on hunger strike for more than a month, and was described by his legal team as "close to starvation".
However, last weekend he was declared well enough to travel back to the UK by a team of British officials who had visited him.
Former Guantanamo detainee Moazzam Begg told the BBC Radio 4's Today programme there were no procedures in place to help people readjust to normal life.
"There is no rehabilitation programme, nothing as far as the government is concerned, which helps to reintroduce this person into normal society after, in the case of Binyam, ... seven years without charge or trial," he said.
"Binyam has been tortured terribly we believe. So those sorts of conditions, for the strongest of us, are very difficult to deal with, and in the case of somebody who returns to this country, where he has no family members, it's going to be doubly difficult."
The US Department of Justice declined to comment on the individual case of Mr Mohamed and said it was policy not to do so until a transfer had actually happened.
Meanwhile, the BBC has learned the UK government will not press for the remaining UK Guantanamo detainee Shaker Aamer to be freed.
The US government has previously refused requests to release Mr Aamer and a Foreign Office spokesman said Britain is "no longer in active discussions" for his release.
However, campaigners disputed this, saying Mr Aamer's lawyers had confirmation in writing from the Foreign Office that the government was still calling for his return.
Amnesty International said the release of Mr Mohamed would be a "huge relief" but called for other prisoners to also be immediately freed or allowed fair trials.
UK director Kate Allen said: "It's nothing short of a disgrace that Binyam has been held in harsh conditions for all these years, having to resort to a hunger strike to raise awareness of his plight."
Protests to free Mr Mohamed outside the US Embassy in London
Campaign group Reprieve also welcomed the news.
Director Clive Stafford Smith said: "This is truly wonderful news for Binyam Mohamed, who wants nothing more than to return to normal life in Britain."
Liberal Democrat foreign affairs spokesman Edward Davey said the release was "long overdue".
"With Mr Mohamed back in the UK, the government will have to come clean over any British role in his alleged rendition and torture," he said.
"The attorney general has a huge responsibility on her shoulders. There can be no political influence into the direction of this investigation."
Mr Mohamed's allegations of torture have been at the centre of a legal row involving two High Court judges.
They have complained that Mr Miliband blocked them from making public information relating to the case, for national security reasons.
Shadow foreign secretary William Hague said the decision to release Mr Mohamed should now pave the way for this information to be released.
"There is [now] no reason for the government not to ask the US to allow the controversial paragraphs related to his case to be published," he said.