Danish soldiers take part in a NATO exercise on the Estonian-Latvian border on May 25, 2022.

Danes overwhelmingly voted to join the European Union’s defense policy on Wednesday, in yet another sign of how Russia’s invasion of Ukraine is reshaping the bloc’s security landscape.

The referendum, which was backed by about two-thirds of voters, will see Denmark scrap its EU defense opt-out. It is the last of the bloc’s members to sign up to the common policy.

“When a freedom threat knocks on Europe’s door and there is once again a war on our continent, then we cannot remain neutral. We support Ukraine and the people of Ukraine,” Danish Prime Minister Mette Frederiksen said in a speech Wednesday evening, reacting to the result.

“Tonight, Denmark has sent a very important message. To our allies, to NATO, to Europe, and we have sent a clear message to Putin.”

Denmark had been the only member of the 27 nation bloc not part of its Common Security and Defense Policy. The Scandinavian nation of nearly 6 million secured exemptions to that policy in a 1993 referendum on the Maastricht Treaty, which laid the groundwork for the modern EU.

The move to join the pact is another important symbolic shift in defense policy for European states, which have had to radically reassess their security since Russia launched its invasion of Ukraine in February. It follows historic applications by Denmark’s Nordic neighbors, Finland and Sweden, to join NATO last month – both cited the war in Ukraine as a motivating factor.

European Commission President Ursula Von der Leyen reacted on Twitter, writing: “I welcome the strong message of commitment to our common security sent by the Danish people today. Denmarks expertise on defense is much valued. I am convinced that both Denmark and EU will benefit from this decision.”

“It looks like after 30 years, Danes have decided it’s time to get rid of the opt-out, and build a closer cooperation in Europe,” said Soren Pape Poulsen, leader of the Danish Conservative Party, noting that close cooperation with Denmark’s allies has not been more important since the Cold War.

Just weeks after the Russian invasion of Ukraine, the Danish parliament made a historic agreement to increase defense spending by 7 billion kroner ($1 billion) over the next two years. The same agreement called for phasing out Russian gas, as well as calling the current referendum on joining a shared EU defense policy.

Danish Prime Minister Mette Frederiksen has said that Russia’s invasion of Ukraine was a significant factor that led the government to call a referendum, and that the vote was an important value-based decision and a way to signal support for a stronger EU. The government has spent several weeks campaigning for a “yes” vote.

“This is the right decision for our future. We are facing an era with even more uncertainty than what we see now, and we need to stand together,” Frederiksen said.

Denmark is a founding member of NATO, but participating in the EU’s Common Security and Defense Policy would enable Denmark to take part in joint EU military operations, such as those in Somalia, Mali and Bosnia.

“NATO will of course remain our most important tool, but the EU gives us another tool in securing our defense in the east,” said Mogens Jensen, a defense spokesman for the ruling Social Democrats.

Danish voters cast their ballots at a polling station in Viborg on Wednesday.

While the EU will benefit from the extensive Danish experience in military operations as part of NATO and other alliances, a “yes” vote will be mostly viewed as a symbolic win in Brussels, according to Kristian Soby Kristensen, a senior researcher at Copenhagen University’s Centre for Military Studies.

“The political significance will outweigh the military contribution,” Kristensen told Reuters.

A large majority in parliament recommended abolishing the opt-out. Wednesday’s vote was the third such attempt by Danish lawmakers to lift one of the 1993 opt-outs after votes on the euro in 2000 and justice and home affairs in 2015, both of which failed. It is the ninth vote on EU issues since Denmark voted in favor of European Community membership in 1972.

Among the key concerns expressed by political opponents and the public was the deployment of Danish soldiers, although any major decisions, including military participation, would still need approval by the Danish parliament.

The EU has no plans to establish a supranational army within the bloc, but it has decided to form a rapid deployment force consisting of up to 5,000 soldiers.