Former New Zealand soldier Ko Haapu, who has arrived back in New Zealand, says he was assaulted by guards while in detention in Australia.
Mr Haapu had been held without charge in a maximum security prison in Perth since early November.
He was detained after his visa was revoked under tough new Australian immigration laws.
Mr Haapu had no criminal history, and had not been charged with anything, but his membership of the Rebels Motorcycle Club saw his Australian visa revoked on "character" grounds.
Calls for the 34-year-old to be released came from New Zealand politicians and former colleagues in the New Zealand Army, but Australian Immigration Minister Peter Dutton insisted they were justified in detaining him.
Mr Haapu rose to the rank of Lance Corporal in the New Zealand Army.
He served in Afghanistan, where he was involved in a gun battle in which fellow solder Lieutenant Timothy O'Donnell was killed, and was part of a security detail for Prime Minister John Key.
He had been fighting deportation, but after four and a half months in Casuarina Prison, and with no prospect of release, he agreed to return to New Zealand.
Mr Haapu told Checkpoint with John Campbell he was subjected to solitary confinement and, when released from solitary, put in cell blocks with murderers, rapists and paedophiles.
He said he was constantly provoked by prison staff, including an assault in which he was handcuffed and his head smashed into a window, which he believed was an attempt to get him to commit an offence so he could be charged with something.
"They would just keep pushing and pushing, and trying to get us to break."
He described claims by Mr Dutton that he had a damning secret file on Mr Haapu as "crap".
More than 100 detainees have been deported to New Zealand from Australia since November,