The French Polynesian assembly has elected the leader of the Union For Democracy, Oscar Temaru, as the new president.
He was chosen by 27 of the 44 members present in the second round of voting, defeating Edouard Fritch of the Tahoeraa Huiraatira.
The third candidate and former president, Gaston Tong Sang, was eliminated in the first round after which he and his 12 backers left the assembly.
Mr Temaru has now been made president for a third time after last losing office in December when the Tahoeraa and defectors from Mr Temaru's camp chose Mr Tong Sang.
Mr Temaru now has five days to form a government amid suggestions from his camp that he may form a unity government after the apparent reconciliation with his erstwhile rival and Tahoeraa leader, Gaston Flosse.
Last month, the French government announced plans to shorten the term of the current assembly and call early fresh general elections.