Sydney – 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. The prime minister then  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.

New South Wales state police Commissioner Andrew Scipione said police had asked that Monis not be granted bail, but the court ruled otherwise.

“We were concerned that this man got bail from the very beginning,” Scipione said.

Asked why Monis was not on any national security watch list, Scipione noted that the charges Monis faced were not politically motivated.

“Can we, should we, would we? Clearly, we work on a priority-based system so if somebody is on a national security watch list, then we pay particular attention to them,” he said. “But on this occasion, this particular individual was not.”

The siege began when Monis walked into the Lindt Chocolat 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.”

Some of the hostages had managed to escape from the cafe earlier in the day. Among the first group to flee was 83-year-old John O’Brien, who told reporters he had originally stopped into the cafe for a quick cup of coffee after finishing up an appointment with his eye doctor.

“I have never felt such a relief as I did when I turned that corner and saw the armed police waiting,” he said, declining to go into any specifics of what happened in the cafe because he was still talking to police.

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 cafe 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 #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.

“Apparently seeing an opportunity, Tori grabbed the gun,” Sydney’s Catholic Archbishop Anthony Fisher said at a memorial service on Tuesday. “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 have Monis extradited from Australia 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.

Channel Seven cameraman Greg Parker witnessed the siege from the network’s studios, which are located opposite to the cafe. The network broadcast live footage from the scene until police asked that they cut the feed. The cameraman said in an interview with the network on Wednesday that a police sniper soon joined him, as he had the perfect vantage point to see through the cafe’s windows.

As the siege dragged into the night, Parker said Monis grew visibly agitated, shoving the hostages and positioning them between himself and the windows. When a gunshot rang out just after 2 a.m., the sniper said, “Window two, hostage down,” prompting police to storm the cafe.

“If they hadn’t have moved when they moved this could have been much, much worse,” said Scipione, the police commissioner.

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.