Substitute Jakub Blaszczykowski struck the decisive blow in Marseille as Poland bounced back from their goalless draw with Germany to beat Ukraine 1-0 on Tuesday.
It took the Borussia Dortmund midfielder - who spent last season on loan at Fiorentina - nine minutes to open the scoring after his introduction in Poland's final game of Group C at Euro 2016, netting with a fierce strike that flew into the top-left corner.
Blaszczykowski's goal lifted the pressure on Adam Nawalka's side after a tough first half that saw Ukraine enjoy the better openings.
They failed to convert any of them, though, as Mikhail Fomenko's men finished the tournament with three defeats and without finding the back of the net.
Poland progress to the knock-out rounds of a European Championship for the first time and will meet Switzerland on June 25 in Saint-Etienne, where they will hope to see Robert Lewandowski end his worrying goal drought.
For the sixth successive international game the Bayern Munich striker failed to score, while he has not found the back of the net in over 500 minutes at the Euros.
With the last 16 in their sights Poland made a bright start and could have been three goals ahead in the opening five minutes.
Arkadiusz Milik was first to test Andriy Pyatov with a low drive, before Lewandowski failed to find the top corner after being set up by his strike partner.
The offside flag denied Lewandowski another opportunity moments later and Ukraine nearly made them pay as Roman Zozulya was played in by Oleksandr Zinchenko, however Michal Padzan was on hand to nullify the threat.
Ukraine found themselves in behind the Poland defence in the 17th minute, but Lukasz Fabianski narrowed the angle to force Andriy Yarmolenko to fire wide.
The previously quiet Yevhen Konoplyanka burst into life on the half hour with a surging run off the Ukraine left, but the Sevilla winger's low shot rippled the side netting.
Four minutes after the restart Ukraine were again on the offensive as Konoplyanka delivered a teasing cross into the penalty area, only for Zinchenko to head over.
That miss proved costly as Blaszczykowski made his mark in the 54th minute, the midfielder creating room for himself before lashing a left-foot shot past Pyatov.
Ukraine's attempts to salvage a point from disappointing campaign created half chances for Yarmolenko, Konoplyanka and Zinchenko, but all were spurned.
Roman Zozulya headed wide with nine minutes to play as Poland clung on to all three points, although they are left to settle for second in the group due to Germany's superior goal difference.