All teams in Group E finished with four points, but Ukraine are out because of the goal difference.
Romania and Slovakia got the 1-1 draw that sent both teams into the round of 16 at Euro 2024, with the Romanians topping Group E ahead of Belgium.
During a thunderstorm and pounding rain midway through the second half, both teams chased a winning goal in a frenetic spell of play despite the tied score suiting them both.
Romania advanced atop the group with Slovakia in third because second-place Belgium drew 0-0 with last-place Ukraine, which are eliminated.
Belgium will play France in the round of 16.
Slovakia led in the 24th minute when Ondrej Duda directed a powerful header down into the corner of the net. Răzvan Marin levelled in the 37th from a penalty awarded after a two-minute video review to decide if Ianis Hagi was tripped inside the area.
Romania will now play in the knockout round for the first time since Euro 2000 when Hagi’s father, national soccer icon Gheorghe, was the captain in the No. 10 jersey now worn by his son.
When the soccer anthem “Freed From Desire” played after the final whistle, both sets of fans were singing and jumping in celebration with the players. Romanian fans far outnumbered the Slovaks with yellow-shirted supporters in about two thirds of the Waldstadion area.
Romania’s reward is going into what shapes as the weaker half of the knockout bracket, separated until the final from in-form Spain and Portugal plus France and Germany.