Media said that two people, including the gunman, had been killed. New South Wales police declined to comment on the reports, and it was not clear whether the fatalities occurred during the rescue operation itself.
Heavy gunfire and loud bangs from stun grenades filled the air shortly after 2 a.m. local time.
Moments earlier at least six people believed to have been held captive managed to flee the scene after several loud bangs were heard coming from the cafe.
Medics were seen trying to resuscitate one person after the raid and took away several injured people on stretchers, said a Reuters witness at the scene in downtown Sydney.
The operation began shortly after a police source named the gunman as Man Haron Monis, an Iranian refugee and self-styled sheikh facing multiple charges of sexual assault as well as being an accessory to murder.
He was also found guilty in 2012 of sending offensive and threatening letters to families of eight Australian soldiers killed in Afghanistan, as a protest against Australia's involvement in the conflict, according to local media reports.
Although he was well known to the authorities, security experts said preventing attacks by people acting alone could still be difficult.
"Today's crisis throws into sharp relief the dangers of lone wolf terrorism," said Cornell University law professor Jens David Ohlin, speaking in New York.
"There are two areas of concern. The first is ISIS (Islamic State) fighters with foreign passports who return to their home countries to commit acts of terrorism.
"The second is ISIS sympathizers radicalized on the internet who take it upon themselves to commit terrorist attacks to fulfil their radical ideology.
"We are entering a new phase of terrorism that is far more dangerous, and more difficult to defeat, than al Qaeda ever was."
During the siege, hostages had been forced to display an Islamic flag, igniting fears of a jihadist attack.
Australia, a staunch ally of the United States and its escalating action against Islamic State in Syria and Iraq, is on high alert for attacks by home-grown militants returning from fighting in the Middle East.
News footage showed hostages holding up a black and white flag displaying the Shahada - a testament to the faith of Muslims. The flag has been popular among Sunni Islamist militant groups such as Islamic State and al Qaeda.
At least five hostages were released or escaped on Monday, with terrified cafe workers and customers running into the arms of paramilitary police.
A further 15 or so hostages were understood to have been holed up inside the cafe.
The incident forced the evacuation of nearby buildings and sent shockwaves around a country where many people were turning their attention to the Christmas holiday following earlier security scares.
In September, anti-terrorism police said they had thwarted an imminent threat to behead a random member of the public and days later, a teenager in the city of Melbourne was shot dead after attacking two anti-terrorism officers with a knife.
The siege cafe is in Martin Place, a pedestrian strip popular with workers on a lunch break, which was revealed as a potential location for the thwarted beheading.
In the biggest security operation in Sydney since a bombing at the Hilton Hotel killed two people in 1978, major banks closed their offices in the central business district and people were told to avoid the area.
Muslim leaders urged calm. The Australian National Imams Council condemned "this criminal act unequivocally" in a joint statement with the Grand Mufti of Australia.
Concerns about an attack in Australia by Islamists have been growing for more than a year, with the security agency raising its national terrorism public alert to "high" in September.