David Hicks can now profit from his memoir after the Australian government dropped its case against him. Photograph: Tim Wimborne/Reuters

The Australian government has dropped its court battle to seize profits from a book written by a former Guantanamo Bay detainee, saying his admissions of terrorist activity before a US military commission could not be relied upon.

David Hicks, who was captured in Afghanistan in 2001 and spent more than five years at the US prison camp in Cuba, said he felt vindicated by the decision. A plea deal in 2007 allowed him to return to Australia to serve a nine-month prison sentence for providing material support to al-Qaida.

Last year, the government launched a court action against Hicks, arguing he should not be allowed to profit from his autobiography, Guantanamo: My Journey, because he is a convicted criminal. Hicks is believed to have made around A$10,000 ($10,300) from sales of the book.

On Tuesday, prosecutor Lionel Robberds told New South Wales state supreme court justice Peter Garling the government had decided to drop the case. In a statement, the prosecutor's office said there was insufficient evidence to continue.

In Australia, criminals can be sued for money that a federal court determines is proceeds from their crimes, including indirect profits from book and movie deals. But it was unclear whether Australia's criminal profit law applied to Hicks because he pleaded guilty before a US military commission part of a justice system that has been widely criticised by lawyers and governments as unfair.

Hicks's lawyers had argued their client could not be sued under Australia's criminal profit law because the conditions at Guantanamo amounted to duress.

In a statement on Tuesday, Hicks's legal team said the Commonwealth decided to drop the case weeks after the lawyers provided evidence of the circumstances under which Hicks pleaded guilty, "including instances of severe beatings, sleep deprivation and other conditions of detention that contravene international human rights norms".

The Commonwealth director of public prosecutions said in a statement Hicks had provided "evidential material not previously available" to prosecutors after the initial legal challenge over his book profits was launched.

The prosecutor's office did not explain what that evidence was, but said it subsequently decided that Hicks's admissions to the US military commission could not be relied upon and opted to drop the case.

Justice Garling ordered the government to pay Hicks's court costs.

"In a way I feel that this has cleared my name," Hicks said outside court following the hearing. "I hope that now the Australian government acknowledges that Guantanamo Bay and everything connected with it is illegal."

Hicks was captured in Afghanistan by the US-backed Northern Alliance in late 2001. In his autobiography, he wrote that he had undergone military training in Afghanistan at a camp that al-Qaida's former leader Osama bin Laden visited, but he denied it was terrorist training.

He wrote that he admitted to a charge of providing material support to al-Qaida so he could escape Cuba. He said his only options were to plead guilty to a crime he did not commit or commit suicide.