Fijian opposition parties have reached a deal to form a new coalition government, ending Prime Minister Frank Bainimarama's nearly 16-year rule.
His Fiji First party and the rival People's Alliance, led by Sitiveni Rabuka, were left in a deadlock following last week's election.
The kingmaking Social Democrat Liberal Party (SODELPA) has now voted 16-14 in favour of backing Mr Rabuka.
"[The people] have voted for change and we have given them that," he said.
The decision comes after two days of intense courting of the right-wing SODELPA and its three seats by Fiji First and the People's Alliance. SOPDELA's leader, Viliame Rgoibulu Gavoka, has demanded key ministerial posts in any new government.
The centre-left National Federation Party, which made a pre-election deal with the People's Alliance, will also be involved in the new government.
The coalition announcement has broader regional significance. Both parties have signalled a desire to cool relations with China, which has been steadily increasing its financial and diplomatic interests in the Pacific.
"I feel like breaking open the ceiling and celebrating man," a supporter of the new coalition told AFP from Mr Rabuka's campaign headquarters after the result of the coalition vote was announced. "It's been 16 years of this oppressive government."
Mr Bainimarama came to power in a 2006 coup, one of a series of political upheavals since Fiji gained independence from the UK in 1970. The rivalry between the indigenous Fijian and the ethnic Indian communities has been at the root of much of the tensions.
In 2013 the constitution was changed to remove a race-based electoral system that favoured indigenous Fijians over the country's large Indian population.
Mr Bainimarama later won two elections to legitimise his rule. Human rights groups have for years accused him of restricting freedom of speech through media censorship and intimidation of his critics.
However, in recent years he has gained a high international profile for his advocacy around climate change. The 68-year-old has already said he would respect the result of the election but has yet to comment on the end of his premiership.
Meanwhile, Mr Rabuka is a former international rugby player who was the leader of Fiji's first coup in 1987, which was staged as an attempt to restore political rights to Fiji's native population. He served as prime minister in 1992-99.
Mr Rabuka was questioned by police on Friday, following his calls for the military to intervene over the election. The poll has been marred by fraud allegations.