Denmark looked set to join the EU's defence policy after a referendum on Wednesday, an exit poll suggested.
The referendum comes after Nordic neighbours Sweden and Finland decided to apply for Nato membership, with many European countries shoring up their defences to face up to a newly hostile Russia.
Denmark is already in Nato, but is the only EU member that is not part of the bloc's defence and security policy, after the country secured exemptions in a 1993 referendum.
An exit-poll by public broadcaster DR, published as polling stations closed, showed 69 per cent of voters were in favour of removing an opt-out to the EU's Common Security and Defence Policy.
Thirty-one per cent of voters polled were opposed, DR said.
"Right now, we are the only country that cannot contribute and we are not allowed to take responsibility for European co-operation in this area, even in a situation where there is a war on our own continent," Prime Minister Mette Frederiksen said on Tuesday before the referendum.
Ms Frederiksen campaigned to join the policy.
Taking part in the EU defence policy would allow Denmark to take part in the bloc's joint military operations, such as those in Somalia, Mali and Bosnia and Herzegovina, and to co-operate on acquiring joint military capabilities.
The final results are expected to be published later on Wednesday.
The bloc has ambitions to deepen its defence integration and set up a 5,000-troop rapid response force, superseding an earlier set of “battle groups” that have never been used and in which Denmark had no part.
Denmark won the defence opt-out after voters rejected the Maastricht Treaty, which created the modern EU, in 1992.
They were persuaded to change their minds after the government negotiated that and other exemptions.
Since then, Denmark has remained outside the eurozone, which it rejected joining in a 2000 referendum, and the bloc's common policies on justice and home affairs.
But Ms Frederiksen called the defence referendum two weeks after Russia's invasion of Ukraine, having reached an agreement with a majority of parties in Parliament.
She also announced plans to increase defence spending to 2 per cent of national income, in line with Nato membership requirements, although not until 2033.
Germany plans to put €100 billion ($107bn) towards upgrading its army, while Poland and the Baltic states will also increase spending.
Eleven of Denmark's 14 parties have urged voters to say yes to dropping the opt-out, representing more than three quarters of seats in Parliament.
Supporters say joining the common defence policy would strengthen European unity, increase Danish influence and show the country’s reliability as an ally.
Two far-right eurosceptic parties and a far-left party say Denmark should keep the opt-out. Opponents fear the country will be dragged into a conflict and that the EU will eventually gain its own fully fledged army.
“In the worst case, it could lead to a weakening of Nato and thus our common defence,” the New Right party said.
The EU treaties contain a clause requiring mutual assistance if any country is attacked. But Sweden and Finland judged this was no substitute for Nato and its American-backed defence guarantee.