Australia's prime minister acknowledged Wednesday that the nation's security system failed to keep track of a gunman responsible for a deadly siege at a Sydney cafe, and promised a transparent investigation into why the man was not on any terror watch list despite having a long criminal history.

Man Haron Monis, a 50-year-old Iranian-born, self-styled cleric described by Prime Minister Tony Abbott as deeply disturbed, took 17 people hostage inside a downtown Sydney cafe on Monday. Sixteen hours later, the siege ended in a barrage of gunfire when police rushed in to free the captives. Two hostages were killed along with Monis.

"The system did not adequately deal with this individual," Abbott conceded on Wednesday. "Two very decent people are dead, others are injured, others are traumatized because of a madman who was roaming our streets."

Monis was convicted and sentenced last year to 300 hours of community service for sending what a judge called "grossly offensive" letters to families of soldiers killed in Afghanistan between 2007 and 2009. He later was charged with being an accessory to the murder of his ex-wife. Earlier this year, he was charged with the 2002 sexual assault of a woman. He had been out on bail on all the charges.

Just three days before Monis began his deadly rampage, Australia's highest court refused to hear his appeal against his convictions for sending the letters.

High Court documents show that Chief Justice Robert French and Justice Chief Stephen Gageler ruled at 9:50 a.m. on Friday that the full bench of their court would not hear Monis's constitutional  challenge to his convictions. At 9:44 a.m. the next business day, a shotgun-wielding Monis walked into the cafe, just a short stroll from the courtroom where the ruling was delivered.

Abbott said the government would publish a report on how the siege unfolded, why Monis was not on the nation's terrorism watch list, and how he managed to obtain a shotgun in a country with strict gun ownership laws.

The prime minister acknowledged it was impossible for security agencies to monitor everyone, forcing them to make judgment calls about who posed the greatest risk for committing violence against innocent people.

"We want to know why he wasn't being monitored given his history of violence, his history of mental instability and his history of infatuation with extremism," Abbott said.

The siege began when Monis walked into the cafe during Monday morning rush hour, trapping 17 customers and staffers inside. He had some of the hostages record videos of themselves reciting his demands: to be delivered a flag of the Islamic State group and to speak directly with Abbott. He forced some to hold a flag with an Islamic declaration of faith above the shop window's festive inscription of "Merry Christmas."

Thousands of tearful Australians continued to pour into Martin Place on Wednesday, a plaza in the heart of Sydney's financial and shopping district where the Lindt Chocolat Cafe -- the site of the siege -- is located. A makeshift memorial had grown into a mountain of flowers left to honor the hostages killed: Katrina Dawson, a 38-year-old lawyer and mother of three, and Tori Johnson, the cafe's 34-year-old manager. Officials have not said if the two died in crossfire as police stormed in or were shot by their captor.

Small boxes of Lindt chocolates had been left among the candles, flowers and cards, and a steady stream of mourners signed memory books for the victims.  A wooden cross with the words "I'll ride with you!" lay nearby, referring to the hashtag (hash)IllRideWithYou which was tweeted tens of thousands of times by Australians offering to accompany people dressed in Muslim clothes who were afraid of a backlash.

Bouquets were also attached to the police barricades that surround the cafe, along with an Australian flag emblazoned with the words, "Vale Tori Johnson" and "Hero," a nod to reports that Johnson brought the standoff to an end by grabbing Monis' shotgun, saving the lives of most of his fellow hostages.

"It's always the innocent," murmured 76-year-old Clare Azzopardi as she surveyed the sea of flowers, the scent of which could be detected a block away.

She began to cry as she queried why Monis had been allowed to roam free, and why two people who had done nothing wrong had lost their lives.

"A woman going about her business with three young children and Christmas coming up and the manager of a coffee shop ... they won't ever be forgotten," she said, wiping tears from her eyes. "We always think we're so isolated here, but this proves we're not."

At an emotional memorial service attended by hundreds on Tuesday, Johnson was lauded for his reported heroism.

"Apparently seeing an opportunity, Tori grabbed the gun," Sydney's Catholic Archbishop Anthony Fisher said at the service. "Tragically, it went off, killing him. But it triggered the response of police and eventual freedom for most of the hostages."

Monis grew up in Iran as Mohammad Hassan Manteghi. In 1996, he established a travel agency, but took his clients' money and fled, Iran's police chief, Gen. Ismail Ahmadi Moghaddam, told the country's official IRNA news agency Tuesday. Australia accepted him as a refugee around that time.

The police chief said Iran tried to extradite Monis in 2000, but that it didn't happen because Iran and Australia don't have an extradition agreement.

New South Wales courts have become more likely to release defendants awaiting trial on bail rather than hold them in custody in part to reduce prisoner numbers in Australia's most populous state.

"There is a real problem with overcrowding of prisons and there is a real need to manage rates of incarceration," said Greg Barton, a global terrorism expert at Monash University in Melbourne.

The standoff ended at around 2 a.m. Tuesday when heavily armed police stormed into the cafe after hearing gunfire inside.

Four people were injured, including three women who were hospitalized in stable condition after being treated for gunshot wounds, and a police officer who was released from the hospital after being treated for shotgun pellet wounds.