Australia's ruling conservatives have been confirmed winners in last week's general election, after opposition Labor leader Bill Shorten conceded.
Mr Shorten said it was clear PM Malcolm Turnbull's coalition had won, adding that he had already congratulated him.
Votes are still being counted, but the government is expected to win just enough seats for a majority.
However, a strong swing against it has left doubts about its agenda and Mr Turnbull's leadership.
The Liberal-National coalition still remains short of the 76 seats it needs to claim a majority in the lower house, the House of Representatives.
But it should secure at least 74, and also has the support of three independent and minor party politicians - Cathy McGowan, Andrew Wilkie and Bob Katter - guaranteeing budget supply and confidence.
Labor is currently on 66 seats, with five still in doubt.
"It is clear that Mr Turnbull and his coalition will form a government," Mr Shorten said.
"So I have spoken to Mr Turnbull earlier this afternoon to congratulate him
and [his wife] Lucy and to wish them my very best."
Malcolm Turnbull has his majority, but he is beset on all sides.
Inside his party he faces a restless right wing that disapproves of his small-l liberal leanings.
Opposition leader Bill Shorten is taunting Mr Turnbull at every opportunity and predicting a return to the polls within a year.
The Senate promises to be unruly - several senators elect are already bickering. With Australia's AAA credit rating under a cloud, Mr Turnbull will need to corral populist senators into passing budget cuts.
The prime minister has his party's support for now, but his enemies are watching closely.
Former Australian leader Paul Keating once said Mr Turnbull was brilliant and fearless, but had no judgment. The prime minister can't afford to put a foot wrong now.
Stringent requirements for verifying votes meant the count progressed slowly after the 2 July poll.
Postal votes, which are counted after votes received on polling day, heavily favoured the coalition and helped them across the line in a number of closely run electorates.
The tight result is likely to put pressure on the government's agenda, particularly in the Senate, where many independent and minor party candidates are set to take office.(BBC)