The gunman killed in a hostage situation in Sydney, Australia has been identified as Man Haron Monis, an Iranian refugee and self-styled sheik who once sent hate letters to the families of dead Australian soldiers.

Monis, 50, was killed in a shootout with police at a Lindt chocolate café in Sydney Monday night, after a tense 16-hour standoff involving 17 hostages held inside. Two hostages were killed and four other people injured in the ordeal.

It was not Monis' first encounter with police.

Monis pleaded guilty in August 2013 to 12 counts of using the Australian postal service in a menacing, harassing or offensive way. His partner, a woman named Amirah Droudis, also pleaded guilty to aiding him. Monis was sentenced to 300 hours of community service and released on a good behaviour bond.

Monis and Droudis sent letters to the families of Australian soldiers within days of their deaths between 2007 and 2009. The letters reportedly told families that their dead loved ones were child-murderers, and that they were going to hell.

The self-proclaimed Muslim cleric said his letters were "flowers of advice."

Monis fought the letter-writing charges for years through a number of high court challenges and appeals. He also occasionally appeared at the courthouse wearing chains, and once chained himself to a railing and waved a tiny Australian flag, according to reports.

Monis and Droudis also faced charges in connection with the death of his 30-year-old ex-wife in Australia last year. Officials said the woman had been stabbed multiple times, then set on fire.

Droudis was charged with murder, while Monis was charged as an accessory before and after the fact.

Monis was charged earlier this year with the sexual assault of a woman who allegedly came to him for "spiritual healing."

He also faced a number of other sexual assault charges relating to alleged incidents between 2000 and 2002, when he claimed to offer "spiritual healing" to a number of women.

A website allegedly associated with Monis shows photos of dead children, accompanied by text condemning Australia's participation in U.S.-led airstrikes in the Middle East. "The more you fight with crime, the more peaceful you are," says the post, dated Dec. 14.

Another post on the site says Monis has given up being a "Rafidi" – a pejorative term for Shia Muslims – to become a "Muslim."

The site, which has now been taken down, included videos and quotes referring to Monis' arrest in the hateful letter-writing campaign.

"From now on when I want to advise people not to kill children I should do it by hand delivery, not by using postal service!" says a post on the site.

Archived versions of the site show sporadic updates over the past 10 years. One version of the site from 2011 accuses an Australian TV station of making a "terrorist broadcast." Another post slams Queen Elizabeth II for not responding to a written letter from Monis. The site includes a number of rants and open letters in its archived history. All of them are signed "Sheik Haron."

The site says he was the son of a Muslim cleric and was born in Boroujerd, Iran, where he lived under the name Ayatollah Manteghi Boroujerdi.

Monis had been living in Australia since 1996.