Footage showed people fleeing the building
The gunman holding people hostage in a Sydney cafe has been identified as an Iranian refugee who was on bail facing a number of charges.
Man Haron Monis, who was granted political asylum in Australia, was described by his former lawyer as an isolated figure, who was acting alone.
Police say they will maintain central Sydney in lockdown until the hostages are brought out unharmed.
As midnight (13:00 GMT) fell negotiations continued with the gunman.
A black Islamic flag has been displayed at the window. The number of those held in the Lindt cafe is not clear.
Five people have run from the building, located in Martin Place - a busy shopping area in Sydney's financial district. It is unclear whether they were released or escaped.
It appears the gunman has used three of the hostages to pass on demands, making them stand beside a black flag and having them make statements to a camera.
Prime Minister Tony Abbott said it was "profoundly shocking" that people were being "held hostage by an armed person claiming political motivation".
News organisations say he has contacted them to issue demands, which police have urged media not to report.
Channel 7, a broadcaster with offices facing the cafe, said lights inside the premises had been turned out as night fell.
"Our only goal tonight, and for as long as this takes, is to get those people that are currently caught in that building out of there safely," New South Wales State Police Commissioner Andrew Scipione said.
Man Haron Monis is the suspected assailant behind the Sydney Lindt cafe siege
The incident began as people arrived for work in Martin Place early on Monday. Witnesses saw a man with a gun walk into the Lindt chocolate shop and cafe.
About 10 employees and 30 customers were thought to be inside at the time, Lindt said. Nearby offices were evacuated.
Hundreds of police have sealed off the Martin Place area
An enormous police operation is in place, on a scale few Sydney residents will have seen, the BBC's Jon Donnison reports from Sydney.
About six hours into the siege, three people were seen running from the building. Two more people followed about an hour later.
"Those people are now being assessed to make sure their health is okay and then police will talk to them," New South Wales Police deputy commissioner Catherine Burn said.
The suspect has been seen inside the cafe wearing a backpack and a bandana.
The atmosphere in Martin Place itself was surreal. Office workers who had been evacuated from their buildings, construction workers from building sites and tourists packed the pedestrian plaza one block away from the Lindt coffee shop.
Rosemary D'Urso Healion had just come out of the Martin Place subway station and was walking to her office when she saw that it was blocked by police. Then she saw the police close down the subway station.
"I work in that building [where the siege is taking place] and I was just about to go in," she told the BBC, adding that she had been in contact with some of her colleagues who were in the building but not being held hostage.
She remained at Martin Place anxiously watching a police operation that appeared to be aimed at getting some of her colleagues out via a ladder erected on a window ledge on the first floor.
Police have been escorting people out of nearby buildings
Shortly after the siege began TV footage showed people, thought to be employees and visibly distressed, holding up to the window a black flag bearing a declaration of the Islamic faith in Arabic.
Martin Place is home to the state premier's office and the headquarters of major banks.
In September Australia - which has sent fighter jets to join the US-led coalition conducting air strikes against Islamic State in Iraq - carried out a big anti-terror raid.
One man was charged with plotting to behead a member of the public in Martin Place.
In October, the Australian parliament approved new anti-terrorism laws, including a provision designed to stop Australians fighting in overseas conflicts.
A black flag bearing the white Arabic text of the "shahada", the basic statement of the Islamic faith, is used by jihadist groups worldwide