Australia's prime minister Malcolm Turnbull has at last claimed victory in a dramatically close national election that has left the country in limbo for more than a week.
But with official results still days or even weeks away, it was unclear whether Mr Turnbull's Liberal Party-led coalition had won enough votes to govern in its own right, or whether it would need the support of independent and minor party lawmakers to form a minority government.
Either way, Mr Turnbull faces a rough road ahead with a divided party, a splintered Senate and a politically weary public that has endured five changes of prime minister in as many years.
Though millions of votes still need to be counted, there was no way for the opposition centre-left Labour Party to win a majority of seats in the House of Representatives, where parties form governments.
That prompted opposition leader Bill Shorten to formally concede the race on Sunday, which in turn triggered Mr Turnbull to announce that the coalition had won a second three-year term.
"We have resolved this election and done so peacefully," Mr Turnbull said.
Asked whether he thought his party would win a majority, Mr Turnbull replied simply, "We've won the election."
The coalition entered the race with a comfortable majority of 90 seats, and few had predicted it would suffer such steep losses. The result has raised the prospect that Mr Turnbull could face a leadership challenge from colleagues unhappy with the party's weak showing.
Even if he manages to hang onto his job, he has a slew of problems to contend with. The moderate leader needs to face the more conservative lawmakers in his party who are angry about his performance and upset that he ousted his predecessor, Tony Abbott, in an internal leadership ballot less than a year ago.
He will also need to deal with a fragmented Senate that could make it tough for him to pass laws.
Though the final make-up of Parliament's upper house is unlikely to be known for weeks, no party will win a majority of seats.
That means even if Mr Turnbull gets contentious legislation passed by the House, he would still have to try and strike deals with the opposition or a disparate group of Senate independents and minor parties to get it signed into law.
Despite the tight race, it became clear in recent days that Labour would not be able to win enough seats to form a government, prompting the opposition leader to formally concede on Sunday.
"I hope for our nation's sake the coalition does a good job," Mr Shorten said. "I hope they run a good government."
He said that his party would work with the coalition to find common ground, saying he understood Australia's need for a functioning Parliament.
He also said it was time Australia considered ditching its pencil-and-paper ballots for a speedier electronic system. That is one area in which he and Mr Turnbull are aligned; the prime minister has long advocated for a move to electronic voting.
"We're a grown-up democracy," Mr Shorten said. "It shouldn't be taking eight days to find out who has won."