The South Pacific territory of New Caledonia chose to remain French on Sunday, narrowly rejecting independence in a tightly-fought referendum marked by a high turnout.
The vote rejecting a breakaway from France after almost 170 years came in at 53.26 percent, down from 56.7 percent in a referendum two years ago.
French President Emmanuel Macron -- who had said previously that "France would be less beautiful without New Caledonia" -- on Sunday said he was grateful to the archipelago's voters.
"I welcome this sign of confidence in the republic with a profound sense of gratitude," Macron said from his office.
He added that he also felt "humility" at the outcome which showed a clear progression of the pro-independence vote compared with the referendum in 2018.
Sunday's vote was part of a carefully negotiated decolonisation plan agreed in 1998 which ended a deadly conflict between the mostly pro-independence indigenous Kanak population and the descendants of European settlers.
That violence culminated in a bloody, drawn-out hostage crisis in 1988 that saw 19 separatists killed, along with six police and special forces personnel.
- 'Quite surprising' -
Another referendum can be held by 2022 so long as the poll is requested by at least a third of the local legislature.
"We are going to get a third referendum," said Roch Wamytan, president of the pro-independence Congress party, as yes-voters celebrated their performance across the territory.
Macron said in his Sunday address that "we now have two years for dialogue and to imagine the future, and not just the institutional future."
Political observers had forecast a win for the no-vote, but few expected it to be so close.
"The results are quite surprising, with numbers showing real progress for the yes camp," said Pierre-Christophe Pantz, a New Caledonia-based geopolitics expert.
In the capital Noumea, a loyalist stronghold, the pro-independence vote added nearly four points to come in at 23.3 percent.
Overall turnout was 85.64 percent, more than four points higher than last time, as the prospect of a tight race brought voters out in droves, patiently awaiting their turn at polling stations.
"I waited 45 minutes. It's very important for me to vote," said retiree Germaine Le Demezet in Noumea.
"I have children and grandchildren here, the future needs to be clear and we need to know what's going to happen to us."
- 'We need to know' -
New Caledonia has taken strict measures to keep coronavirus out of the territory, and with case numbers low, the referendum took place without masks and other measures.
New Caledonia, situated between Australia and Fiji and sometimes called "The Pebble", was seized by France in 1853 and is home to 270,000 people.
The economy's mainstays are the production of metals, especially nickel of which New Caledonia is a major global producer, as well as tourism and financial support from mainland France.
The French government, from more than 16,000 kilometres (10,000 miles) away, subsidises the territory with around 1.5 billion euros ($1.75 billion) every year, the equivalent of more than 15 percent of New Caledonia's gross domestic product.
The last colonies to gain independence from France were Djibouti in 1977 and Vanuatu in 1980.
French Prime Minister Jean Castex said in the run-up to the poll that he planned to talk to all the main actors after the referendum.