In a blitz-style assault early Tuesday, Australian riot police ended a 16-hour hostage crisis as frightened captives rushed onto the streets amid intense gunfire that fatally wounded the self-styled Muslim cleric who held them.

A police statement said two people - a 34-year-old man and a 38-year-old woman - died during the predawn police operation in downtown Sydney. The statement also said that a third person, described by police officials as the hostage-taker, was pronounced dead after being taken to a hospital.

Four others were injured, including a police officer who suffered a gunshot wound to the face.

The motives for the hostage-taking at the Lindt Chocolat Cafe remain unclear. But the gunman was convicted last year of sending hate mail to families of Australian troops killed in Afghanistan and was facing other charges, including in connection with the killing of his former wife.

The decision to carry out the police raid was apparently prompted by worries that the gunman, identified as Iranian-born Man Haron Monis, was growing uneasy and had begun corralling some captives in a section of the cafe.

"They made the call because they believed that, at that time, if they didn't enter, there would have been many more lives lost," said Andrew Scipione, commissioner of the New South Wales state police.

The long showdown captured the world's attention and raised questions about whether it was a "lone wolf" attack inspired by calls from militant groups such as the Islamic State. Earlier this month, when a woman in the United Arab Emirates fatally stabbed an American teacher, Abu Dhabi officials partially blamed the slaying on the influence of radical Islamists.

Islamic State and other extremists had threatened Australia with violence for its participation in the U.S.-led campaign against Islamist militants in Iraq and Syria. Australia, in response, imposed new security measures in recent months and made several arrests of suspects accused of plotting acts of violence.

The raid at the Lindt Chocolat Cafe began without advance warning. Suddenly, a series of bangs sounded - possibly from stun grenades - and a barrage of gunfire followed. Police poured in, weapons drawn and face masks in place. Hostages raced in the other direction, some with hands raised.

Scipione said the gunman initially took 17 people hostage. Five people later escaped as the drama unfolded, including scenes in which captives were forced to hold a black Islamic flag to the window.

Monis, 50, a self-proclaimed "spiritual healer," was sentenced to 300 hours of community service for sending the threatening and harassing letters to the families of the fallen military personnel.