Updated at 4.10pm
Exit polls in Australia's climate-dominated election campaign pointed on Saturday to a win for Labour after six years of conservative rule.
Between 16 and 17 million people were expected to vote across the vast island-continent in a bitterly fought election that may be the first anywhere decided by climate policy.
As the first polls closed, a Nine-Galaxy exit poll showed Bill Shorten's Labor beating the governing Liberal coalition 52-48, which would signal a clear parliamentary majority for the opposition. A second poll for Ten network showed a similar margin of victory.
The polls are still open in the west of the country.
Later in the day, those predictions were turned on their head when Shorten conceded defeat in a stunning upset.
Casting his ballot in Melbourne, would-be prime minister Shorten was bullish about forming a majority government after a final poll before the vote showed his lead increasing.
"Today is the people's day," he said. "Be it buying a 'democracy sausage', the kids having a bit of a sugar cake or what have you, and voting," he added, referring to the tradition of serving grilled sausages on election day.
"In the event that the people of Australia voted to stop the chaos and voted for action on climate change, we will be ready to hit the ground from tomorrow."
Weeks ago, Prime Minister Scott Morrison's conservative Liberals had been heading for an electoral drubbing.
But he has closed the gap with a negative campaign and backing from the country's biggest media organisation owned by Rupert Murdoch, mainly targeting older, wealthier voters who face fewer tax breaks under Labor.
After casting his vote in the Sydney suburbs, Morrison acknowledged the challenge his coalition faced, saying, "I don't take anyone's support in this country for granted."
"Australians know very well what it is we are saying in terms of keeping our economy strong, keeping our budget under control... keeping Australians safe and secure," he said, hitting the conservatives' key talking points against Labor.
But anger over his government's inaction on climate change may prove the real difference between the two parties.
Australia is one of the most vulnerable of all developed nations to climate change and a season of record floods, wildfires and droughts have brought the issue from the political fringes to front and centre of the campaign.
In traditionally more conservative rural areas, climate-hit farmers are demanding action. And in several rich suburbs, a generational shift has seen eco-minded candidates running Liberal party luminaries close.
In northern Sydney, former prime minister Tony Abbott -- who once described climate change as "crap" -- appears at risk of losing a seat he has held for more than two decades to independent challenger Zali Steggall, a lawyer and Olympic medallist in Alpine skiing.
Early rising voters in the constituency trickled into a beachside surf club to cast their ballots, as volunteers wearing bright orange "I'm a climate voter" t-shirts handed out pamphlets.
Shorten has pledged quick legislation to increase renewable energy, while the Liberals said they would not risk the coal-fuelled economy's health to make the air cleaner.
Australia is among the world's largest exporters of coal, providing thousands of jobs in the northeast of the country.
Candidates egged
The campaign has been an often ill-tempered pitched-battle. Candidates have been egged and abused, and a slew have resigned for racist, sexist and otherwise jaw-dropping social media posts.
In Abbott's battleground seat, a 62-year-old man was arrested and charged with thrusting a corkscrew into the stomach of someone putting up campaign banners on the eve of the election.
If Morrison wins, it would be a monumental comeback, having scraped for his political life in the hope of not entering the history books as one of the shortest-serving prime ministers in Australian history.
He took office last August after a party room coup by conservative hardliners that ousted moderate pro-climate leader Malcolm Turnbull -- the latest in a series of political fratricides that have made Canberra politics look like "Game of Thrones" meets "The Hunger Games".
Much of Morrison's cabinet has resigned or gone into virtual hiding during the campaign because of their unpopularity.
If Shorten is elected, he would become the sixth prime minister sworn into office in a decade.
The former union leader has struggled with low personal approval ratings but has become a more polished campaigner as the election has neared.
Still, his relative lack of charisma was underlined Thursday by the death of much-loved former prime minister Bob Hawke, an Oxford-educated lovable rogue, equally at home chugging a pint or debating Keynesian economics.
Voting in Australia is mandatory and due to a complex system where voters must rank all candidates in each electorate, officials said it could take hours after the polls close before the election outcome is known.