Poland sealed their place in the Euro 2016 knockout stage after beating Ukraine 1-0 in their final Group C game.
The win, secured by a goal from substitute Jakub Blaszczykowski, meant they finished behind Germany only on goal difference.
Poland got off to a bright start and missed two chances to take the lead inside the opening five minutes.
Arkadiusz Milik broke away down the left and raced into the penalty area but blasted his attempted finish too close to goalkeeper Andriy Pyatov.
And moments later, star striker Robert Lewandowski sidefooted over from close range after a low cross from the left had found him inside the area.
But already eliminated Ukraine, with no points from their opening two matches, struck back when Andriy Yarmolenko delivered a cross that had Poland goalkeeper Lukasz Fabianski flapping before it was cleared.
And as Poland found themselves backpedalling, Yevhen Konoplyanka made a fine run to set up Roman Zozulya, who was denied by a last-ditch block from Michal Pazdan.
Yarmolenko then made and missed a chance of his own, swiping an effort wide after a good run, before a Lewandowksi shot on the turn at the other end was blocked.
On the half-hour mark, Konoplyanka hit the side netting with a strike from outside the area as Ukraine showed far more ambition than had been apparent in their opening group stage defeats to Germany and Northern Ireland.
After their bright start, Poland had faded alarmingly -- but they did have something to be optimistic about just before the break when Tomasz Jodlowiec also tried his luck from the edge of the box but saw his strike saved.
Poland brought on Blaszczykowski for reported Liverpool target Piotr Zielinski at the break -- and the move paid off in spectacular fashion.
Minutes after Oleksandr Zinchenko had headed over for Ukraine, Blaszczykowski broke the deadlock, shooting home after a short corner from a sharp Milik touch.
That galvanised Poland, who could have doubled their lead within a minute as Bartosz Kapustka, found by Lewandowski, could only fire into the side netting.
As Ukraine attempted to get back into the match, Yarmolenko had a fierce shot blocked and saw a dangerous cross headed clear.
But their search for a first goal of the tournament was becoming increasingly fruitless and they could have been 2-0 down when Milik, unmarked from a cross, failed to get the right connection on his header.
Ukraine fashioned late chances when Artem Fedetskyi got away down the right but Zozulya could only direct a header wide, and Ruslan Rotan saw a drive saved.
Konoplyanka tried one last snap-shot -- but it was easily dealt with and Ukraine went out of the tournament without a goal to their name.