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.
Australia’s PM Tony Abbott said it was “profoundly shocking” that people were being “held hostage by an armed person claiming political motivation”.
Shortly after 2AM local time on December 16, several hostages fled from the building.
Minutes later, army commandos with assault rifles and wearing helmets and body armor 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:44AM local time in a tweet, promising details later.
The commandos who stormed the building were from the Royal Australian Regiment.
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, Man Haron Monis 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 Man Haron Monis’ 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.
yelMwzD9KiIThe US House Ethics Committee has voted to release its report on former Republican Representative…
ABC News has agreed to pay $15 million to President-elect Donald Trump to settle a…
South Korea’s parliament has voted to impeach President Yoon Suk Yeol over his failed attempt…
Israeli war planes have carried out more than 100 air strikes in Syria on December…
President-elect Donald Trump has threatened to impose 100% tariffs on the BRICS countries if they…
Syrian troops have withdrawn from the city of Aleppo following an offensive by rebels opposed…