Australian commandos have stormed a cafe in Sydney, ending a 16-hour siege by a gunman identified as an Iranian refugee who took dozens of hostages.
Paramedics carrying stretchers raced towards the cafe moments after the commandos entered the building. Several people were injured.
Unconfirmed local reports say two people, including the gunman, died.
The centre of the city has been in lockdown since the gunman seized the hostages early on Monday morning.
Early in the siege, hostages were forced to hold up a black Islamic banner at the window.
The cafe is located in Martin Place, a busy shopping area in Sydney's financial district.
Prime Minister Tony Abbott said it was "profoundly shocking" that people were being "held hostage by an armed person claiming political motivation".
Army commandos
We do not know yet what triggered the assault, the BBC's Phil Mercer reports from Sydney.
Shortly after 02:00 local time Tuesday (15:00 GMT Monday), several hostages fled from the building.
Minutes later, army commandos with assault rifles and wearing helmets and body armour could be seen piling into the cafe, tossing stun grenades ahead of them, and apparently opening fire.
Hostages ran to safety with their hands in the air. A man and a woman were seen being carried to safety by emergency services.
New South Wales police announced the end of the siege at 02:44 local time (15:44 GMT) in a tweet, promising details later.
The commandos who stormed the building were from the Royal Australian Regiment, BBC security correspondent Frank Gardner reports.
Sixteen-hour siege
09:45 Monday local time (22:45 GMT Sunday): Police are called out to the Lindt Chocolat Cafe in Sydney's Martin Place, a busy plaza in the heart of the city. Suggestions an armed robbery is under way are soon discounted
10:09: Australian TV stations broadcast footage of hostages holding a black Islamic banner up to the window. The gunman can also be seen, wearing a bandana
12:30: As police flood the area, Prime Minister Tony Abbott goes on national TV to promise a thorough police response to the "deeply concerning incident"
16:00-17:00: Three men, then two women, sprint to safety from the cafe's fire exit
18:30: Police confirm negotiations are under way with the gunman
02:20 Tuesday (15:20 GMT Monday): Several more hostages escape and commandos storm the cafe
02:48: Police officially confirm end of siege. Reports suggest gunman and one other person dead, several people injured
'Isolated figure'
As many as 40 customers and staff were taken hostage. Five managed to escape through a fire exit on Monday afternoon.
Suspected gunman Man Haron Monis, 49, received political asylum in Australia in 1996 and was on bail facing a number of charges.
On a website, now suspended, he describes himself as a Shia Muslim who converted to Sunni Islam.
The self-styled cleric was described by his former lawyer as an isolated figure.
One of his demands was to have a flag of Islamic State, the Sunni militant group which recently seized territory in Syria and Iraq, to be delivered to the cafe.
Martin Place is home to the state premier's office and the headquarters of major banks.
At the nearby Sydney Opera House, evening performances were cancelled as shops and offices in the area shut early due to the security situation.
"It's sad to think this is my home and that it could happen anywhere," onlooker Rebecca Courtney told AFP news agency.
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.
Are you in Sydney? Have you witnessed the hostage situation? You can get in touch by emailing haveyoursay@bbc.co.uk.
If you are willing to talk to a BBC journalist, please leave your number.