Poland beat Switzerland on penalties to reach the Euro 2016 quarter finals after Xherdan Shaqiri's spectacular overhead kick had cancelled out Jakub Blaszczykowski's first-half strike and taken the first game of the knockout stage to extra time.
A dominant Poland had few chances to counter-attack in a first half that they largely controlled.
But a bit of quick-thinking distribution from goalkeeper Lukasz Fabianski put them four against three in the 39th minute and Kamil Grosicki squeezed a pass through to Blaszczykowski to set up the midfielder for the opener.
Switzerland grew into the game and went close to finding an equaliser on 73 minutes when Ricardo Rodriguez's well-struck free kick was brilliantly saved by Fabianski at full stretch.
Striker Haris Seferovic went even closer five minutes later when he crashed a shot off the crossbar as Poland retreated deeper into their own half.
But the equaliser, when it came, was well worth the wait. A layoff for Shaqiri seemed to sit up too high for the midfielder to have a shot, but he produced the goal of the tournament with an acrobatic overhead volley that flew into the bottom corner.
However there was heartbreak for the Swiss supporters when Grzegorz Krychowiak scored the decisive penalty in the shootout, with Granit Xhaka's having smashed his spot-kick wide.
Poland had gone into the game with a much-changed side from the XI that beat Ukraine in their third Group C game. Experienced full-back Lukasz Piszczek came in on the right of defence, with Krzysztof Maczynski, Kamil Grosickin and Blaszczykowski all starting in midfield.
And the initial signs suggested Adam Nawalka's selection was correct, with Poland starting the game much the brighter.
The Group C runners-up should have taken the lead inside the first minute. Yann Sommer was robbed by Robert Lewandowski, with the Switzerland goalkeeper doing superbly to deny the Bayern Munich forward inside the first minute.
The rebound fell to Milik, only for him to slice a first-time effort of target.
A wild shot moments later revealed Milik's frustration, but Poland continued to dominate possession for much of the first half and missed another golden opportunity on 29 minutes when Krychowiak headed well wide when unmarked from a corner.
And Milik wasted a terrific chance with 33 minutes gone, hurrying a shot over the bar when given time and space by a Lewandowski flick-on.
Switzerland -- who had made just one change, with Seferovic replacing youngster Breel Embolo up front -- briefly threatened as Fabian Schar headed straight at Fabianski and Blerim Dzemaili had a deflected shot tipped over the bar by the Swansea goalkeeper.
But the goal Poland richly deserved finally arrived on 39 minutes when Blaszczykowski slid his shot underneath an onrushing Sommer.
Switzerland were much improved after the break with Shaqiri heavily involved, first getting in behind the Poland defence and then testing Fabianski with a stinging shot from distance.
Poland had chances of their own from range -- with Lewandowski and Blaszczykowski forcing Sommer into good saves -- but it was Shaqiri's moment of brilliance with 11 minutes remaining that forced extra time.
Chances were few and far between in the additional 30 minutes, although a free header for Eren Derdiyok after a delightful clipped cross by Shaqiri should have seen Switzerland win it, only for Fabianski to produce his second world-class save of the match.
It is the first time Poland have reached the last eight of a European Championship, and they will face the winners of Saturday evening's game between Croatia and Portugal.