Oscar Temaru is back in power for the fourth time
French Polynesia's assembly has elected Oscar Temaru as the next president after Gaston Tong Sang's resignation.
In the second round of voting, Mr Temaru won 37 votes, 17 more than Mr Tong Sang.
Thursday's presidential election was the third since last year's early general election called by France to increase political stability.
Mr Temaru of the pro-independence Union For Democracy is now president for the fourth time in less than five years.
Mr Tong Sang had resigned ahead of a threatened no-confidence motion which was then cancelled.
Frequent switching of allegiance among a small power elite has resulted in a regular handing of the presidency around a small circle of names.
Gaston Flosse, generally described as pro-France, had ruled French Polynesia for most of two decades until 2004.
Ousted pro-independence president, Oscar Temaru
He was later re-elected when the more pro-independence group of Mr Temaru joined him in a coalition last year.
That was ousted by Mr Tong Sang after two defections to his side in April 2008.
In the latest voting, the group formerly aligned with Mr Flosse backed Mr Temaru in the deciding second round of voting.
A fourth candidate, Sandra Levy Agami, secured only one vote.
There have been seven changes of government since the general elections of 2004.
Mr Tong Sang remains mayor of Bora Bora.