Algerian authorities fed incorrect information to UK officials about a terror suspect later charged with the ricin poison plot, a tribunal was told.
The home secretary says Y is a threat to national security
The man, 35, known as Y, was cleared of the plot but the government say he is a threat to national security.
Y says sending him back to Algeria would breach his human rights.
Y's lawyers told the Special Immigration Appeals Commission the Algerians, who wanted Y for other crimes, told an informant what to say.
Ben Emerson QC, for Y, said the informant, used by British security services to get information on Y, probably had "words placed in his mouth by the Algerian military service".
The informant's evidence lost "credibility and reliability" because he had been held for more than 12 days by Algeria's military intelligence service - the DRS - and was allegedly beaten by them, Mr Emerson added.
"There has been manipulation and subterfuge by the Algerian authorities to create the information that they were feeding to their British counterparts that can only cast doubt upon the information from this man," he sad.
The information had been full of "inconsistencies", Mr Emerson said.
That Y was someone the Algerian security services were "very keen to get their hands on and have been for a long time" could not be overlooked, Mr Emerson said.
An Algerian Court in 1997 and 1998, in Y's absence, sentenced him to death and life imprisonment for terror offences.
An earlier sitting of the London tribunal heard from Ian Burnett QC, for the home secretary, that Y had "extensive Islamic extremist connections".
He may have trained in Afghanistan and had been found to have "significant numbers" of false documents, the tribunal was told.
Campaigners argue that this is the first appeal against deportation to a country where it is accepted that a person would be at risk of torture or death.
Under human rights laws suspects cannot be deported to countries where they may face abuse.
The home secretary says there are no substantial grounds for believing that Y would be at risk of torture on his return to Algeria and that his appeal should be dismissed.
Britain is seeking to sign a "memorandum of understanding" with Algeria, aiming to guarantee that anyone returned there would not be ill-treated.
Y arrived in Britain on a false French passport in March 2000. He claimed asylum, showed his genuine passport and was granted indefinite leave to stay in June 2001.