Canada and Denmark have finally settled a largely good-natured "war" fought for decades with weapons such as flags, whiskey and schnapps over a tiny, barren, and uninhabited outcrop in the Arctic.

The two sides were to formally announce Tuesday a deal to split Hans Island and effectively create the first land border between Canada and Europe at a signing ceremony in Ottawa with Canadian and Danish foreign ministers.

Dividing up the kidney-shaped island and resolving the 49-year-old benign impasse was to be held up as a model for peacefully resolving territorial disputes — contrasted with Russia's invasion of Ukraine.

"The Arctic is a beacon for international cooperation, where the rule of law prevails," Canadian Foreign Minister Melanie Joly said.

"As global security is being threatened, it's more important than ever for democracies like Canada and Denmark to work together, alongside Indigenous peoples, to resolve our differences in accordance with international law."

The row over the 1.3 square kilometer (0.5 square mile) Hans Island, which sits between Ellesmere and Greenland, dates back to 1973, when a marine boundary was drawn between Canada and Greenland, part of the Danish kingdom.

Danes and Canadians have visited it by helicopter over the past decades to lay claim to it, leading to diplomatic protests, online campaigns and even a Canadian call to boycott Danish pastries.

During those ministerial visits, each side would plant a flag and leave behind a bottle of whiskey or schnapps for the other to enjoy.

The snow-covered site is uninhabitable, but the onset of global warming is bringing more ship traffic to the Arctic, and opening it up to fishing and resources exploration — although maybe not in the area of Hans Island.

Arctic expert Michael Byers noted that "the island is so incredibly remote as to make it uneconomical to contemplate any serious activity there."

Putting off resolution of this unusual territorial dispute, however, made for good political theatre in both countries, flaring up ahead of elections.

"It was an entirely risk-free sovereignty dispute between two NATO allies over an insignificant, tiny island," Byers told AFP.

Denmark also feared that losing the ownership battle would undermine relations with Greenland, while Canada worried that a loss would weaken its negotiating position in a more consequential dispute with the United States over the Beaufort Sea, in far north-western Canada, believed to be rich in hydrocarbons.

Most recently, Canadian Prime Minister Justin Trudeau "has not made Arctic sovereignty part of his brand," in contrast to his predecessor, Byers said. "So that reduced the temperature, at least from our side."

"But most importantly, Russia invaded Ukraine, and that created an opportune moment to tell the world that responsible countries settle territorial disputes in a peaceful way," he said.