French Polynesia's pro-independence Tavini Huiraatira party has won the election for a new 57-member territorial assembly, paving the way for Moetai Brotherson to become president.
Unofficial final results show the party led by its founder Oscar Temaru won 44.3 percent, thereby repeating its win in the first round of voting two weeks ago.
The pro-autonomy list formed 12 days ago between the ruling Tapura Huiraatira and the opposition Amuitahiraa came second with 38.5 percent while another autonomist party A Here Ia Porinetia secured 17.2 percent.
As the list winning most votes, the Tavini gets 19 of the 57 seats as a bonus, securing a total of 38 seats.
The Tapura-led list won 16 seats and A Here Ia Porinetia three.
Turnout was just under 70 percent, up 10 percent over the first round.
Challenges to the result can be filed for the next two weeks.
The Tavini victory ends the ten-year dominance of the assembly by the Tapura.
The new assembly, which has been elected for a five-year term, is expected to meet in the next two weeks to elect a new assembly president and then a president.
The Tavini candidate for the presidency Moetai Brotherson said he is likely to appoint a majority of women when he forms his government after confirming that Eliane Tevahitua will be the vice-president.
Temaru topped the Tavini list but decided before the election not to seek another term as president.
The Tapura leader and outgoing president Edouard Fritch said despite the Tavini victory, a majority of French Polynesians favour autonomy.
The Amuitahiraa leader Gaston Flosse said his side, which joined the Tapura for the second round, didn't lose the election and denounced Temaru as a liar.
During the campaign, Fritch and Flosse warned of chaos should the Tavini come first.
Brotherson said the election results show people weren't fooled, knowing that independence won't happen next week.
As president, Brotherson said he would represent all the people and seek a dialogue with France as a partner on the basis of mutual respect.
French Polynesia has been on the UN decolonisation list since 2013 but France has to date refused to acknowledge the UN decision and refuses to engage in a UN supervised process.
Observers said the Tapura lost support over displeasure with the government's response to the covid-19 pandemic.
Last year, Fritch and the former vice-president Tearii Alpha were both fined for flouting covid rules they put in place.
Alpha, who was the vice-president at the time, invited 300 people, including all cabinet members, to his wedding at the height of restrictions.
In what was a surprise last year, the Tavini candidates beat the Tapura candidates to win all three of French Polynesia's seats in the French National Assembly.
The last pro-independence politician to hold the presidency was Temaru who held the post for a fifth time between 2011 and 2013.
In reactions from Paris to the election, the interior minister Gerald Darmanin congratulated Temaru and Brotherson and acknowledged that "Polynesians vote for a change".
The left-wing opposition's Jean-Luc Melenchon described the Tavini success as "an historic event".