Danes are voting in an election with Prime Minister Mette Frederiksen's Social Democrats aiming for a third term.


Frederiksen, 48, called the vote months earlier than expected, buoyed by popular support for her handling of US President Donald Trump's threat to annex Greenland, an autonomous Danish territory.


Her Social Democrats have lost support since the 2022 elections and she is facing a strong challenge from two parties on the centre-right, including the Liberal Venstre party of Defence Minister Troels Lund Poulsen.


Denmark is run by coalition governments and Tuesday's vote will decide whether power will stay with a left-wing bloc or move to the right.


Latest opinion polls give Frederiksen's Social Democrats by the far the largest share of the vote, on more than 20%, well ahead of the Liberals and Green Left.


Although the election is not being fought on the Greenland crisis, Frederiksen is gambling that the Trump bump that boosted her poll numbers after her defiant stance on Greenland will be enough to hand her a third term in a tight election race.


Denmark, which has long been one of the closest US allies in Nato, has rebuffed Trump's bids to take over Greenland, and the Danes and their European partners sent a military contingent to the island last January.


Broadly-speaking, however, there is a wide consensus in Denmark on foreign policy, so it is domestic concerns that have dominated the campaign trail.


Instead, the state of the economy and the cost of living are key issues, with Frederiksen proposing a 0.5% wealth tax for the richest 20,000 Danes. The high level of pesticides in drinking water because of pig farming and agriculture has also become a concern for voters, with some parties including Frederiksen's calling for a ban.


However, her party's lead in the polls is not likely to be enough to maintain the 90 seats she needs to hold a majority in parliament.


After a commanding win in 2022, Frederiksen led a coalition across the middle, that saw her Social Democrats team up with the centrist Moderates and right-of-centre Liberals, and all three parties are down significantly in the polls.


Troels Lund Poulsen of the Liberals has emerged as another candidate for prime minister, but he needs a strong showing in Tuesday's vote.


Even with the largest vote share, the Social Democrats are heading for their weakest result in more than a century. In last year's local elections, they slumped to 17%.


The polls suggest neither the red left-wing bloc nor the blue bloc on the right will be able to form a majority without relying on the centrist Moderates of Foreign Minister Lars Løkke Rasmussen to act as kingmaker.


The four parliamentary seats held by Greenland and the Faroe Islands, could also prove influential, with the possibility for the first time in decades that at least one of the Greenlandic seats flips from red to blue.


Rasmussen, who also impressed Danes with his handling of the Greenland stand-off, has already voiced his ambition to take on the task of royal investigator - a key role in forging a governing coalition.


However, the royal investigator normally becomes the next prime minister, and Rasmussen has indicated he has no desire to lead the country again, having served two terms as prime minister in the past.


He told reporters that he wanted to be at the forefront of shaping the next government's policy, with Denmark needing to stand together at a time of division.