Mamdouh Habib was accused of having prior knowledge of 9/11

An Australian man who was held in the Guantanamo Bay US detention camp has won the right to sue his government for complicity in his alleged treatment.

Mamdouh Habib says Australian officials were present at torture sessions he was subjected to while in detention.

A Federal Court said he was free to sue after rejecting Canberra's claim that an Australian judge could not rule on the actions of foreign officials.

Mr Habib was released from Guantanamo without charge in 2005.

He is seeking compensation from the Australian government over its alleged involvement.

'Offends ideals'

Egyptian-born Mr Habib was arrested in Pakistan in 2001, accused by the US of training militants and of having prior knowledge of the 11 September 2001 attacks.

He was detained in Pakistan, Egypt and Afghanistan, before being flown to Guantanamo Bay in Cuba.

Mr Habib says he was subjected to sleep deprivation, being burnt, electrocution and injections of drugs and that Australian officials were complicit in - and sometimes present at - the sessions.

Canberra had asked for the case to be thrown out, saying Australia could not rule on the actions of US officials.

But the Federal Court said torture "offends the ideal of a common humanity" and that Australia's parliament had "declared it to be a crime wherever outside Australia it is committed".

The three-judge panel said torture "can never be justified by official acts or policy", the Sydney Morning Herald reported.

Mr Habib, who has always denied the accusations against him, said he was "really happy" with the court's verdict.

"At least I feel we've still got justice," ABC News quoted him as saying.