Denmark finished second in Group C due to a better disciplinary record than Slovenia after a dull draw with Serbia.
Neither side delivered a performance that reflected their potential, but Denmark was the better team in a forgettable encounter in Munich.
Denmark ended with an identical record to Slovenia, necessitating separation by the number of yellow cards received.
While both Denmark and Slovenia advance, Serbia is out, with none of the three teams winning a group game.
Jonas Wind had a goal disallowed for Denmark in the first half because the ball had gone out of play before he bundled it over the line from a corner.
The Wolfsburg forward also slipped as he tried to connect with a smart flick-on from Rasmus Hojlund, slicing over the bar from a good position, and was substituted at the break.
Denmark continued to create chances despite a subpar display by their standards. Alexander Bah headed wide, and Christian Eriksen’s shot had to be parried behind for a corner.
Serbia, knowing they needed a win due to Slovenia’s stalemate with England in the other Group C match, had just one shot on target, which came in second-half stoppage time.
They had a goal ruled out when Luka Jovic’s shot bounced in off Denmark defender Joachim Andersen in the second half. Striker Jovic had been offside in the build-up.
With their place in the last 16 secure with a draw, a pragmatic Denmark side lacked ruthlessness. Jannik Vestergaard headed a corner delivery at Serbia goalkeeper Predrag Rajkovic, but the Danes rarely tested him in the second half.
As group runners-up, they have set up a tie with tournament hosts Germany in the next round.
“We are representing Danish football and we have to be happy about it,” said Denmark manager Kasper Hjulmand.
“It’s special of course when you play the hosts. It is a fantastic football country with a lot of passion.
“I really love football here in Germany and playing against them with the Danish team – it cannot be better. I can’t wait.”
Denmark ease into last 16 as Serbia struggle
All four teams from Group C had a chance of reaching the knockout stages before Tuesday’s matches began, but Serbia never seemed poised to win this one.
Despite being cheered on by 24-time Grand Slam tennis champion Novak Djokovic from the stands, Serbia failed to rise to the occasion and exited the competition with a whimper.
A few opportunities emerged late in the game as Aleksandar Mitrovic curled a shot wide, Dusan Vlahovic’s header landed on the roof of the net, and Sergej Milinkovic-Savic struck their first shot on target—but Denmark remained unfazed.
It was a disappointing performance from Serbia, whose supporters jeered at half-time, and frustrations mounted in the second half when referee Francois Letexier ruled out their goal for offside.
Plastic cups were thrown onto the pitch, causing play to be stopped twice as stewards and Denmark goalkeeper Kasper Schmeichel cleared them, followed by an announcement pleading with fans to stop hurling objects.
Jovic and Dusan Tadic were brought on at half-time as Serbia sought inspiration, but Denmark continued to control possession while avoiding significant risks.
“We’re talking about one goal that sends you up or down. Denmark and Slovenia progress without any victories,” said Serbia boss Dragan Stojkovic, referring to those teams having each drawn all three of their games.
“Tonight we were very equal. The luck was on the other side. We are not here to try to find reasons. We haven’t won. That’s the end of the story.”
Denmark boss Kasper Hjulmand seemed content with a point, substituting Manchester United striker Rasmus Hojlund and key midfielder Morten Hjulmand. Morten Hjulmand will miss the Germany match after receiving his second booking of the group stage. Christian Eriksen was also replaced with a few minutes remaining.
Player of the match: C. Eriksen