A man who spent five years at the US prison camp in Guantanamo Bay was released on bail on Thursday after serving two months' jail in Bangladesh, his lawyer said.