Binyam Mohamed, the British resident held at the Guantánamo Bay detention centre, is expected to be flown back to the UK early next week after a deal was agreed today on his transfer.

The foreign secretary, David Miliband, said in a statement this afternoon that the UK and US governments had reached agreement on the move and Mohamed would be returned to Britain "as soon as the practical arrangements can be made".

Mohamed, 30, was born in Ethiopia and lived in the UK before his arrest in Pakistan in 2002 on suspicion of involvement in terrorism. His supporters have campaigned for him to be allowed to return to Britain. He has been held at Guantánamo Bay in Cuba since September 2004.

He went on a hunger strike for more than a month at the start of this year and was described by his legal team as close to starvation. British officials who travelled to Guantánamo last weekend said he was well enough to travel to the UK.

No date has been confirmed for his return to Britain but reports suggest it could be as early as Monday.

Miliband said Mohamed's return did not constitute a commitment that he can remain in the UK permanently. "His immigration status will be reviewed following his return and the same security considerations will apply to him as would apply to any other foreign national in this country."

The attorney general is consulting the director of public prosecutions over whether to order a criminal investigation into claims that intelligence and security agents were involved in torturing Mohamed.