Updated 4.19 p.m. and 7.30 p.m.

Three people are dead after a hostage drama in a Sydney cafe ended in heavy gunfire as security forces stormed the building, Australian police said.

The lone hostage-taker was among those killed.

Heavy gunfire and blasts from stun grenades filled the air shortly after 2 a.m. local time (4pm Malta) at the Lindt cafe in central Sydney, bringing to an end a siege that had lasted more than 16 hours.

The hostage taker, who was a 50-year-old Rianian man, as well as two hostages, a 38-year-old woman and a 34-year-old man died.

Two people were taken to hospital with non-life threatening injuries, while a police officer was being treated after being hit in the face with gunshot pellets. A woman was being treated for a gunshot wound to the shoulder, police added.

Police swooped into the Lindt Chocolat Cafe shortly after five or six hostages were seen running out of the building. 

The dramatic scene unfolded shortly after the gunman was identified by local media as Iranian-born Man Haron Monis, who is facing charges including sexual assault and accessory to murder in separate cases. 

Monis has long been on officials' radar. Last year, he was sentenced to 300 hours of community service for writing offensive letters to the families of soldiers killed in Afghanistan.

He was later charged with being an accessory to the murder of his ex-wife. Earlier this year, he was charged with the sexual assault of a woman in 2002. He has been out on bail on the charges.

"This is a one-off random individual. It's not a concerted terrorism event or act. It's a damaged goods individual who's done something outrageous," his former lawyer, Manny Conditsis, told Australian Broadcasting Corp.

"His ideology is just so strong and so powerful that it clouds his vision for common sense and objectiveness."

Throughout the day, several people were seen with their arms in the air and hands pressed against the window of the cafe, and two people holding up a black flag with the Shahada, or Islamic declaration of faith, written on it.

The Shahada translates as "There is no god but God and Muhammad is his messenger". It is considered the first of Islam's five pillars of faith.

A number of Australian Muslim groups condemned the hostage-taking in a joint statement and said the flag's inscription was a "testimony of faith that has been misappropriated by misguided individuals".

In a show of solidarity, many Australians offered on Twitter to accompany people dressed in Muslim clothes who were afraid of a backlash from the cafe siege. The hashtag #IllRideWithYou was used more than 90,000 times by late evening.

Seven Network television news staff watched the gunman and hostages for hours from a fourth floor window of their Sydney offices, opposite the cafe.

The gunman could be seen pacing back and forth past the cafe's windows. Reporter Chris Reason said the man carried what appeared to be a pump-action shotgun, was unshaven and wore a white shirt and a black cap.

Earlier, network staff counted about 15 different faces among hostages forced up against the windows.

"The gunman seems to be sort of rotating these people through these positions on the windows with their hands and faces up against the glass," Mr Reason said in a report from the vantage point.

"One woman we've counted was there for at least two hours - an extraordinary, agonising time for her surely having to stand on her feet for that long."

"When we saw that rush of escapees, we could see from up here in this vantage point the gunman got extremely agitated as he realised those five had got out. He started screaming orders at the people, the hostages who remain behind," he added.

Reason later reported that staff brought food from a kitchen at the rear of the cafe and the hostages were fed.

As night set in, the lights inside the cafe were switched off. Armed police guarding the area outside fitted their helmets with green-glowing night goggles.  

Lindt Australia posted a message on its Facebook page thanking the public for its support.

"We are deeply concerned over this serious incident and our thoughts and prayers are with the staff and customers involved and all their friends and families," the company wrote.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.