Parliamentarians in French Polynesia have elected the leader of the pro-independence movement as president.
Oscar Temaru told delighted supporters in the capital Papeete that any future split from France would only happen with clear support from the public.
His appointment brings an end to 20 years of political domination by Gaston Flosse, a friend and ally of French President Jacques Chirac.
The election is the latest in a series of political twists in the territory.
In the last year, French Polynesia 's leadership has changed hands three times against a backdrop of bickering and allegations of electoral fraud.
Such was the chaos that the two protagonists - Mr Temaru and the long-serving conservative Mr Flosse - both claimed to be president at the same time.
France's highest administrative court was called in to arbitrate.
Fresh elections were ordered and were held last month.
However they failed to produce a clear winner, with both sides left with the same number of seats in the local assembly.
Deals were eventually struck, leaving Oscar Temaru in power.
The new president has adopted a conciliatory tone, stressing that independence from France is not an immediate concern.
He said it would only be possible if and when the French Polynesian economy would allow it, and when the people wanted it.
The South Pacific territory was annexed by France in 1880. It relies on the tourism and fishing industries as well as handouts from Paris.