Man Haron Monis wrote letters to the grieving families of troops killed in Afghanistan which compared them to "Hitler's soldiers", and he was accused of helping a woman to kill his ex-wife, who was found stabbed and set alight.

But the social media postings of the 50-year-old who was killed in a police operation to rescue 17 people he had held hostage in a Sydney cafe indicate that he thought of himself as something of a martyr.

The self-styled Muslim cleric, who came to Australia as a refugee from Iran, complained of being tortured in prison for his political beliefs and said he was fighting for Islam and for peace.

"The more you fight with crime, the more peaceful you are," he wrote recently on his website, according to the Site Intelligence Group. In another post he wrote: "I am one of the witnesses for the barbarism of the Australian government."

Monis was free on bail when he used a shotgun to take 17 hostages at the Lindt Chocolat Cafe during rush-hour on Monday morning. He and two hostages died in the early hours of the next day in a barrage of gunfire, when police stormed the cafe.

Australian authorities are now facing questions about why he was allowed out of jail given the seriousness of the charges against him.

"We are all outraged that this guy was on the street," New South Wales Premier Mike Baird said. "We need to ensure that everything is done to learn from this."

Prime Minister Tony Abbott called him a "deluded and sick individual" who was known to police and intelligence agencies but who was not on a terror watch list.

Monis, an Iranian refugee, was sentenced last year to 300 hours of community service for sending what a judge called "grossly offensive" letters to the soldiers' families between 2007 and 2009. The Australian newspaper said they included comparisons to Hitler.

He was also charged with being an accessory to the murder of his ex-wife. Earlier this year, he was charged with the sexual assault of a woman in 2002.

His former lawyer described him as a "damaged-goods individual".

"His ideology is just so strong and so powerful that it clouds his vision for common sense and objectiveness," Manny Conditsis told Australian Broadcasting Corp.

Exactly what that ideology was remains uncertain. Although he took an interest in the Islamic State group, his social media postings do not make clear his level of support for the group.

And the flag of Shahada that he made his hostages hang in the window of the cafe during his siege is a common expression of faith.

"This is a man who had serious history of criminal offences and a history of violence," Deputy Police Commissioner Catherine Burn told reporters. "This was a man that we do believe had some extremist views and we also believe that he was unstable."

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.