A referendum on the abolition of the defence opt-out, one of the country's opt-outs from the European Union, was held in Denmark on 1 June 2022. The referendum was announced on 6 March 2022 following a broad multi-party defence agreement reached during the 2022 Russian invasion of Ukraine. The referendum resulted in the "Yes" side winning with approximately two-thirds of the vote.
 After the rejection of the Maastricht Treaty in the 1992 referendum, the Edinburgh Agreement was reached, which gave Denmark four opt-outs in the European Union (EU), one of which was on defence matters. The Maastricht Treaty was subsequently ratified in 1993. The defence opt-out meant that Denmark did not participate in the Common Security and Defence Policy or EU military operations. In addition, the opt-out meant that Denmark did not participate in the decision processes in the EU related to military operations.
 This is the third referendum to be held in relation to the country's opt-outs. In 2000, the Danish electorate rejected the adoption of the euro as national currency, and in 2015 a proposal to modify the justice opt-out was also rejected. For a referendum to be rejected, a majority of participating voters must vote against, and the voters voting against must represent at least 30% of the electorate; however the parties behind the defence agreement have agreed that the result of the referendum should stand regardless of the turnout.
 The defence agreement was signed and presented by the leaders of the Social Democrats, Venstre, Socialist People's Party, Social Liberal Party, and the Conservative People's Party. The parties endorsed the agreement, which also included increased defence spending and the aim of ending the country's dependency on Russian gas. Liberal Alliance and the Christian Democrats have also endorsed the "Yes" option, while the Independent Greens voted "Yes" but did not recommend voters what they should vote. The Danish People's Party, New Right, Young Conservatives and the Red–Green Alliance have opposed the abolition of the opt-out, recommending the electorate vote "No".
 On 30 March, the Danish Foreign Ministry released two bills (draft laws) for organising the referendum and joining the Common Security and Defence Policy (CSDP). Following this, the wording of the referendum question, which did not mention the European Union nor the opt-out, was criticised by the Danish People's Party and the Red-Green Alliance. Jeppe Kofod, Denmark's Foreign Minister, defended the wording, emphasising that the vote was about joining the other 26 EU member states. Following the criticism, Kofod announced a changing to the wording on 7 April, which read: "Do you vote for or against Denmark's participation in the European defence and security co-operation by abolishing the EU defence opt-out?"
 Concern was raised that eliminating the opt-out and participating in the CSDP could eventually lead to Denmark having to join a European army if one were to be created in the future.  Foreign Minister Kofod committed that any such change would require treaty revisions, which would be put to the Danish people for approval in a new referendum.
 Four major television debates involving the leaders of parties represented in the Folketing were held.
 The result meant that 43.38% of the registered electorate had voted for the proposal, and 21.49% had voted against.
 Exit polls released by national broadcasters DR and TV 2 immediately after polls closed at 20:00 CEST (18:00 UTC) showed a large majority of the electorate had voted "Yes". This was the first time that Denmark had ever abolished one of its EU opt-outs. This was the largest share of the vote ever received by the "Yes" side in an EU-referendum, with the result being described by some as a landslide. The turnout at 65.8% was noted as one of the lowest of any EU referendum, with only the 2014 Danish Unified Patent Court membership referendum having had a lower turnout. Election scholars expressed concern and attributed the low turnout to some parties being hesitant to campaign, as well as the opinion polls prior to the election showing the yes side having a large lead.
 Prime Minister Mette Frederiksen commented that she was "very very happy" for the result, and said that Denmark had sent a very important signal to its allies and a clear signal to Vladimir Putin. She also praised the cooperation with the other parties that had advocated in favour of the referendum. Frederiksen emphasised that there were no plans to abolish Denmark's remaining opt-outs, promising that the referendum had been "about the defence opt-out and nothing else". Venstre leader Jakob Ellemann-Jensen said that the vote sent a clear result that other countries could count on Denmark. He then focused on the next Danish general election, saying that the country's right-wing should work together to give Denmark a new government.
 Morten Messerschmidt commented that the result showed that the Danish People's Party was alive. He said that many people's votes were "influenced by the war in Ukraine". Political Spokesperson of Red–Green Alliance, Mai Villadsen, said that she had "very great respect" for the result of the election. She mentioned that many of the party's voters had voted "Yes", and promised that the party would remain engaged with defence policy. 
 European Commission President Ursula von der Leyen welcomed the result and said that Denmark and the EU "would benefit from the decision". French President Emmanuel Macron said that it was a "fantastic news for our Europe" and that "we are stronger together".
 With the end of the EU defence opt-out effective from 1 July 2022, the Danish government had the power to request Denmark's participation in the European Defence Agency and Permanent Structured Cooperation. On 23 March 2023, the Danish Parliament approved participation in the EDA and PESCO. PESCO members voted on Danish participation on 23 May 2023, confirming Denmark's participation in PESCO, Denmark becoming its 26th member.