Millions of Australians voted in a general election on Saturday in which the ruling conservative coalition campaigned on its record of economic management and a resurgent Labor opposition promised action on climate change and tax reform.
Prime Minister Scott Morrison's Liberal-National coalition has been in power since 2013 but has struggled in opinion polls for years, hurt by concerns over instability and party infighting.
Bookmakers had centre-left Labor at almost unbackable odds to regain office.
A final opinion poll by Newspoll for The Weekend Australian newspaper on Friday showed Labor's lead over the coalition at 51.5% to 48.5% on a two-party preferred basis, under which votes for unsuccessful candidates are redistributed until a winner is declared.
"I am nervous because it's a big day, it's a very big deal," Shorten, a former trade union leader, said after voting in his electorate in Melbourne, Australia's second-largest city. "But I'm confident that we have done the homework."
Polling booths opened at 8 a.m. (2200 GMT on Friday) and will close at 6 p.m. (0800 GMT). Voting is compulsory in Australia and there are about 17 million eligible voters.
Preliminary results should be known on Saturday evening.
More than 7,000 polling stations were open across Australia in venues such as surf clubs, schools and public halls. There were also about 90 voting centers overseas.
A two-hour time difference means voting centers in Western Australia state will still be open when initial counts start coming in from the more populous east coast.
Opinion polls earlier in the campaign indicated that Morrison had narrowed Labor's lead but many voters are still angry about the ousting of his socially moderate predecessor, Malcolm Turnbull, in a party-room revolt in August.
"I think it will be a long night," Morrison said earlier on Saturday. "I've always said this election will be close."
Morrison cast his vote later in his Sydney electorate and said he was not making any "presumptions".
"I don't take anyone's support in this country for granted," Morrison said.
The 38-day campaign ended on a sombre note with the death on Thursday of the widely popular Labor stalwart Bob Hawke, who was prime minister from 1983 to 1991. Hawke was 89.
Hawke's death dominated coverage of the final two days of campaigning. Warren Edwards, who stood in line with his wife to vote in Melbourne, thanked Hawke and the Labor party.
"Bob Hawke in 1983 gave me and my wife the first home-buyer's grant," Edwards told Shorten in televised remarks.
Shorten said Hawke's passing made him more determined to win. He seemed to strike a chord with voters who feel financially left behind and are worried about the environment with his promise to cut both generous tax concessions enjoyed by the wealthy and greenhouse gases.
Morrison has criticized Labor's policy as an attack on people's aspirations. Polls show most Australians support stronger action to tackle climate change, while Morrison's coalition strongly supports the coal industry.
Morrison has said Australia would meet its commitment under the 2015 Paris accord to reduce greenhouse gas emissions by between 26% and 28% on 2005 levels, but says more ambitious targets would damage the economy.
Shorten said that, if elected, his government would aim to cut carbon emissions by 45% from 2005 levels by 2030, with net zero emissions by 2050.