A gunman responsible for a deadly siege in a Sydney café was once on the national security agency's watch list — but was dropped off it years ago for reasons that remain unclear, Australia's prime minister said Wednesday.

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 café 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.

Prime Minister Tony Abbott said on Wednesday that Monis was on the Australian Security Intelligence Organisation's watch list in 2008 and 2009 but was later dropped from it. The agency was watching Monis because he had sent a series of offensive letters to the families of dead Australian soldiers, Abbott said.

"I don't know why he dropped off the watch list in those days, I really don't," Abbott told reporters.

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.

"We particularly need to know how someone with such a long record of violence and such a long record of mental instability was out on bail after his involvement in a particularly horrific crime," Abbott said. "And we do need to know how he seemed to have fallen off our security agency's watch list back in about 2009."

Man Haron Monis

Man Haron Monis is shown in 2009, with a message to then prime minister Kevin Rudd, after having been charged with seven counts of unlawfully using the postal service to menace, after sending harassing letters to families of Australian soldiers. (Sergio Dioniso/EPA)

Abbott also said Monis, who wielded a shotgun throughout the siege, had a gun license. But the New South Wales police later said they checked with the state firearms registry and found no record of him ever holding a license.

"Plainly there are questions to be asked when someone with such a history of infatuation with extremism, violent crime and mental instability should be in possession of a gun license," Abbott said. "We have very tough gun laws and I guess we can be pleased that he didn't have a more potent weapon at his disposal. But why did he have a gun license in the first place?"

Abbott's spokesman later released a statement saying that federal security officials had told the prime minister that the National Police Reference System -- a database holding all state and territory police records -- showed that Monis had been the owner of a New South Wales firearms license. The federal police commissioner was investigating the origin of the entry, the statement said.

Abbott promised a transparent investigation into what went wrong. The government was expected to release a report in January looking into all aspects of the siege.

The prime minister said 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.

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.

Gunman denied legal challenge last week

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 café, just a short stroll from the courtroom where the ruling was delivered.

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

'If [police] hadn't have moved when they moved this could have been much, much worse.' - Andrew Scipione, New South Wales police commissioner

"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 Café 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 or Iraq and Syria (ISIS) 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 café 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 café 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 café because he was still talking to police.

Unclear who fired shots fatal to innocent victims

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 café 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 café'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 café, 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.

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.

Monis had been receiving welfare benefits

Abbott said he wanted to know how Monis had been granted permanent residency and why he had been receiving welfare benefits for years, despite being able-bodied "if not necessarily of sound mind."

The standoff ended at around 2 a.m. Tuesday when heavily armed police stormed into the café.

Channel Seven cameraman Greg Parker witnessed the siege from the network's studios, which are located opposite to the café. 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 café's windows.

Martin Place-Sydney-memorial

Condolence messages are written on the pavement as a sign of respect at Martin Place on Wednesday in Sydney. (Joosep Martinson/Getty Images)

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 café.

"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.