French President Emmanuel Macron gives a speech at a traditional costume ceremony at the Jean-Marie Tjibaou Cultural Center in Noumea, New Caledonia, on May 5 at the end of his three-day visit to the French territory. (Ludovic Marin/AFP/Getty Images)

The restaurants offer cuisine worthy of Paris. A French tricolor overlooks the representative assembly chamber. Gendarmes patrol streets shaded by palm trees.

Legally, New Caledonia is as French as Brittany. But the South Pacific possession 10,000 miles from Paris has long been a restless corner of Victor Hugo’s homeland.

Now, it has a chance for independence. On Nov. 4, the territory is scheduled to vote on a separation from France, a momentous step for both sides.

Since fighting a traumatic war in Algeria that led to the African country’s independence in 1962, France hasn’t lost a colonial possession since Djibouti on the Horn of Africa was granted independence in 1977.

President Emmanuel Macron has promised not to take sides. But he wants to preserve France’s influence in the Indian and Pacific oceans, and he is deepening his country’s cooperation with Japan and Australia in a move analysts say is a hedge against rising Chinese naval power and a potentially less engaged United States.

Macron recently spent three days in New Caledonia, where he implied that the territory needed France to protect it from Chinese expansionism.

“In this region of the world, China is building its hegemony, step by step,” he said. “It’s not about fearmongering, but about looking at reality.”

In a way, the South Pacific is the front line of the great power struggle of the 21st century. The region’s beautiful but undeveloped islands are where China’s military and economic expansion comes into direct contact with the military and diplomatic interests of the United States and its allies.

New Caledonia’s reputation as a tranquil Francophone tourist destination — it boasts the world’s largest lagoon — belies sometimes-violent racial conflicts over 150 years.

Tensions between indigenous Kanaks and European descendants reached a climax in 1988 when French police officers were taken hostage — four were killed — and held in a cave on one of the smaller islands for two weeks. A rescue mission ordered from Paris led to the deaths of 19 Kanaks and two French soldiers.

Police battle independence fighters near Saint-Louis farm in Magenta, near Noumea, New Caledonia, on April 24, 1988, two days after the kidnapping of 27 French gendarmes by Kanak separatists. (Remy Moyen/AFP/Getty Images)

The violence forced the French government to negotiate. Several settlements were reached with the indigenous groups, culminating in the Noumea Accord, signed in May 1998. The agreement recognized the trauma to the Kanak people caused by colonization and promised a vote in 2018 on self-determination. It was credited with delivering peace and opening the territory to economic development.

As his domestic economic policies were prompting dissatisfaction at home, Macron arrived in the territory to mark the 30th anniversary of the killings and demonstrate France’s commitment to the islands.

Thousands of nationalists marched through the capital, Noumea, dressed in red, white and blue and waving French flags.

“We are trying to show the president and people in metropolitan France that the majority of Caledonians want to stay in the French republic,” Sonia Backès, a leader of the anti-independence political party that organized the march, told Agence France-Presse.

Macron became the first French president to visit the island of Ouvea, about 100 miles north of Noumea, where the massacre took place. He attended a memorial service for those who died and observed a moment of silence for two Kanak leaders who were assassinated after they signed the peace agreement a year later. He met family members of victims on both sides.

Macron urged all sides to peacefully accept the outcome of the vote. “It is very important to reconcile everyone, which is a precondition of the referendum,” he said.

Analysts say that keeping New Caledonia a French territory is part of Macron’s larger plan to boost his country’s role in the world, including the Pacific.

French President Emmanuel Macron arrives on New Caledonia’s Ouvea Island last month. (Ludovic Marin/AFP/Getty Images)

“This is part of an overall strategy of Macron not only recasting himself but France as able to influence international events,” said Natalie Doyle, deputy director of the European and E.U. Center at Monash University in Australia, in an interview. “He is trying to claim for France a bigger role in Europe after years of Germany calling the shots.”

The visit of the glamorous 40-year-old president, a few weeks after he charmed President Trump, was one of the region’s diplomatic highlights of the year. New Zealand’s new foreign minister and the prime minister of Vanuatu flew in for face time with Macron, who was accompanied by more than a dozen journalists from France.

Even though New Caledonia’s population is only 275,000 — about the size of Strasbourg — secession triggers painful emotions in France. The parallels with Algeria aren’t abstract for many of those involved.

After Algeria was lost in 1962, some white settlers ended up in New Caledonia with their children. Among them was one of the territory’s current representatives in the French congress, Philippe Gomès, who is a leading opponent of independence.

Gomès predicts that the separatist push will fail, although he is among those who are concerned about a backlash from the losing side.

“We must, through the channels of dialogue, ensure that the day after the election nobody feels humiliated and that we continue to build together our community,” he said in an email.

The ethnic Europeans tend to be highly nationalistic. In last year’s presidential election, the far-right candidate Marine Le Pen received nearly 30 percent of the votes in New Caledonia compared with the centrist Macron’s 13 percent.

Economically, French investment has given New Caledonia good living standards in a region that, while physically beautiful, is as impoverished in many places as sub-Saharan Africa.

In nearby Vanuatu, which became independent in 1980, most homes don’t have electricity. New Caledonia has good-quality roads, modern infrastructure and 24/7 power.

But the Melanesian Kanaks, who make up about 44 percent of the population, are generally much poorer than the 27 percent of New Caledonians of European origin.

Most Kanaks are subsistence farmers of yams, taros, sweet potatoes and bananas. They want a new country named Kanaky New Caledonia, which would be funded in part by charging France rent for military access.

“New Caledonians are tired of our current system of society,” independence leader Daniel Goa said in a recent speech. “They cannot take it anymore. I call all the Caledonians to join us so that they participate in the construction of their country.”

But the islands could struggle without French financial support. Apart from tourism, one of the most important industries is nickel mining. New Caledonia has one-quarter of the world’s known deposits of nickel, which is used to make stainless steel. Prices dropped by half from 2014 to 2016, hitting government revenue, although they have partially recovered over the past six months.