The South Pacific archipelago of New Caledonia has voted against independence from France for the second time in as many years, a provisional final count shows.
The "no" vote won 53.26 per cent of votes, with all votes tallied from the territory's 304 polling stations, a narrower margin of victory than in the 2018 poll.
The result will bring relief to French President Emmanuel Macron's government, whose attention had been focused on the coronavirus pandemic in the run-up to the referendum.
"Voters have had their say. They confirmed their wish to keep New Caledonia a part of France. As head of state, I salute this show of confidence in the Republic with a profound feeling of gratitude," Macron said in a televised statement.
A surprise "yes" vote would have deprived Paris of a foothold in a region where China is expanding its influence, and dented the pride of a colonial power whose reach once spanned large parts of Africa, Southeast Asia, the Caribbean and the Pacific.
New Caledonia became a French colony in 1853. Tensions have long run deep between pro-independence indigenous Kanaks and descendants of colonial settlers who remain loyal to Paris.
Sunday's referendum was the second of up to three permitted under the terms of the 1998 Noumea Accord, an agreement enshrined in France's constitution and which set out a 20-year path towards decolonisation.
The island chain already enjoys a large degree of autonomy but depends heavily on France for matters such as defence and education.
Turnout was high at 85.6 per cent of eligible voters - after a stronger-than-expected independence vote in the 2018 referendum.
New Caledonia lies some 1200km east of Australia and 20,000km from Paris.
Under French colonial rule the Kanaks were confined to reserves and excluded from much of the island's economy.
The first revolt erupted in 1878, not long after the discovery of large nickel deposits that are today exploited by French miner Eramet's subsidiary SLN.
Today, its economy is underpinned by annual French subsidies of some 1.3 billion euros ($A2.1 billion) and nickel deposits that are estimated to represent 25 per cent of the world's total, and tourism.
The territory has, however, largely cut itself off from the outside world to shield itself from the coronavirus. It has registered only 27 cases of COVID-19.
After Sunday's "No" vote, a third referendum can be held within two years if a third of the local assembly votes in favour.