Image caption The prisoner was found hanged by a sheet which had been tied to the bathroom window of his cell in Ayalon prison, near Tel Aviv

Israel has confirmed that a detainee reported to have had links to the spy agency, Mossad, hanged himself.

The man - identified in Australian media as Australian-Israeli citizen Ben Zygier - died in December 2010.

He "was found hanging in the shower of his detention cell", according to a court report released after a request to lift a gagging order on the case.

The detainee was known in the media as Prisoner X because his identity and reasons for confinement were so secret.

Israel has not confirmed he was Ben Zygier, as reported by an Australian investigative news programme.

ABC News' Foreign Correspondent programme said Ben Zygier was imprisoned because Israel suspected he had informed Australia's security agency of Mossad operations.

The court report said the prisoner was found hanged by a sheet which had been tied to the bathroom window of his cell on 15 December 2010.

A post-mortem examination concluded he died of asphyxiation.

Written by Judge Daphna Blatman Kedrai and partly published in response to a media petition, the report said there was evidence to suggest that failures by members of the Israel Prison Service caused the prisoner's death.

"I have found evidence allegedly suggesting the fault of elements in the Israel Prison Service," said the judge.

"Orders to prevent suicide were given and the elements entrusted with guarding the prisoner were aware of them. These orders were not upheld and a 'window of opportunity' was used by the deceased to commit suicide."

Mr Zygier, who was 34 when he died, is believed to have been arrested in 2010 and held incommunicado in Israel's maximum security Ayalon prison. His case came to light when an Israeli newspaper website broke the story that year, but the reports were removed after a gagging order was imposed.

On Sunday, Israeli Prime Minister Benjamin Netanyahu defended the necessity of keeping some information out of the public domain.

"We are not like all other countries,'' he said. "We are more threatened, more challenged, and therefore we have to ensure the proper activity of our security forces.''

"Allow the security forces to work quietly so we can continue to live securely and safely," he added.