French Polynesia's territorial assembly has elected Oscar Temaru as its new president.
He was chosen by 29 members while the rival candidate, Gaston Tong Sang, had the backing of 26 members.
Two ballot papers were blank.
Before the vote Mr Temaru told the assembly that the economic situation was such that the territory should go to work.
He also said no new election should be held for another four years.
Mr Tong Sang said the electoral system should be changed for general elections to be held in 18 months.
Mr Temaru has five days to form a government - French Polynesia's fourth in less than a year.