MI5 secretly tried to hire British men held in Guantanamo Bay and other US prison camps by promising to protect them from their American captors and help secure their return home to the United Kingdom, The Independent has learnt.

One of the men, Richard Belmar, was told he would be paid "well" for his services if he was willing to work undercover for MI5. A second detainee, Bisher Al Rawi, was told that if he agreed to work for the security service he would be "freed within months".

Three other detainees were threatened with rendition and harsh detention regimes if they did not co-operate with their British and American interrogators.

Download the new Independent Premium app Sharing the full story, not just the headlines

But MI5 failed to honour the promises made by its agents, a former agent has told The Independent.

The source, who is close to the MI5 officers who conducted the interviews, has confirmed that "assurances" had been given to the British men while they were held in Pakistan, Afghanistan and Guantanamo Bay. But he said that senior officers in London had cleared the actions of its own officers but later reneged on the promises. This is backed up by sworn testimony lodged in the High Court from the former detainees.

"[The agents] fear they will be hung out to dry. This is not the first time that field agents have been made to carry the can even when there is a paper trail all the way to the top authorising the action and conduct of the agents," said the source.

The clandestine recruitment operation was being pursued at the same time that the British Government was supporting American claims that those held at the notorious US naval base represented a serious threat to world security.

Edward Davey, the Liberal Democrats' spokesman on foreign affairs, said: "These allegations show the extent of MI5's involvement with those people who were illegally abducted and held in Guantanamo Bay. It's increasingly clear that Britain must have known much more about American practices at Guantanamo Bay, including water-boarding, than they are prepared to admit."

According to papers before the High Court two MI5 officers, known as "Andrew and Officer B" tried to recruit Mr Belmar while he was held by the Americans in Pakistan in 2002.

He was told that he would have to attend training courses at Thames House, the headquarters of MI5 in London. And in April 2002 "Andrew and officer B" informed Mr Belmar that he would be returning to England in seven days' time. Mr Belmar says on hearing this news he was "extremely relieved and started counting down the days". But on the day of his "releases" he was handed over to US military officers and later transferred to Guantanamo Bay.

Bisher Al Rawi claims that MI5 officers visited him at the US naval base in Cuba to offer him a job working for the security services after his release.

The two officers, who called themselves "Martin and Matt", told him they had "specifically come to see you". The court case alleges: "Mr Al Rawi's shackles and handcuffs were completely removed during this meeting and Martin and Matt brought Mr Al Rawi a McDonald's meal. They asked Mr Al Rawi a number of questions, showed him photographs of individuals they were interested in, and had a lengthy discussion with him. During the meeting a request was made by the men to Mr Al Rawi that he would work for the security services upon being released. They promised that if he agreed he would be released within a few months. Mr Al Rawi agreed to these terms."

The court papers allege that another man, Omar Deghayes, was approached by MI5 while he was detained in Afghanistan in the summer of 2002. The agent, who gave his name as "Andrew", assured Mr Deghayes that if "he helped him and the United States interrogators he would go back home". On the basis of Andrew's assurance, Mr Deghayes agreed to answer Andrew's questions, it is claimed. Similar claims over British assurances are made by Moazzam Begg, the former Guantanamo inmate who was released in 2005.

All five men, and two other former Guantanamo detainees, are seeking compensation from the Foreign Office, the Home Office, MI5 and MI6 and the Attorney General.

A spokesman for the Foreign and Commonwealth Office said that the Government could not comment on on-going legal proceedings.