Substitute Jakub Blaszczykowski struck the decisive blow in Marseille as Poland bounced back from its goalless draw with Germany to beat Ukraine 1-0 on Wednesday (AEST).
It took the Borussia Dortmund midfielder — on loan at Fiorentina last season — nine minutes to open the scoring after his introduction in Poland's final game of Group C at UEFA 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.
It 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 progresses to the knockout rounds of a European championship for the first time and will meet Switzerland on 26 June in Saint-Etienne, where it 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 more than 500 minutes in France.
With the last 16 in its 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 Poland pay as Roman Zozulya was played in by Oleksandr Zinchenko, however Michal Padzan was on hand to nullify the threat.
Ukraine found itself 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 was 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 it is left to settle for second in the group after Germany's superior goal difference and win against Northern Ireland.