The French Polynesian assembly has elected Edouard Fritch of the ruling Tahoeraa Huiraatira Party as the new assembly president.
He won the final round of voting when he secured 28 votes over the 27 given to his rival, Antony Geros of the opposition Union for Democracy.
There were two abstentions in the last round.
Mr Fritch replaces Philip Schyle of the centrist Fetia Api Party in the third highest government position for a one-year term.
In a surprise move, Mr Schyle joined the election by declaring his candidacy for another term after the first and inconclusive round of voting.
Mr Fritch's election came amid a rift within the ruling coalition that saw another candidate, Hiro Tefaarere, secure 11 votes in an early round before his backers gave their support to Mr Fritch.
Mr Fritch is the son-in-law of the Tahoeraa leader, Gaston Flosse, and a former vice-president.