Analysing early results, national broadcaster ABC called the election in favour of Prime Minster Scott Morrison's coalition. It now seems certain that Morrison and his allies will have 72 seats in the new parliament, four short of an absolute majority.
The result is a monumental upset and a failure by the pollsters, who put the opposition Labor party under Bill Shorten in pole position.
Some bookies had paid out early expecting a coalition defeat and all but the most ardent partisans had thrown in the towel.
The prime minister himself described the victory as "miraculous".
Early results appeared to show a fractured electorate with minor populist and rightwing parties playing an outsized role.
Conservative Prime Minister Morrison praised "quiet Australians" for delivering his party a "miracle" election victory Saturday after his Labor challenger conceded defeat.
"I have always believed in miracles!" he told jubilant supporters in Sydney. "How good is Australia!"
Morrison had entered the election as an underdog, but after a hard-fought campaign defied the odds to extend the Liberal-National coalition's six-year rule.