Grezgorz Krychowiak drilled in the winning spot-kick after Granit Xhaka had missed Switzerland’s second penalty to send the Polish fans at the Geoffroy Guichard stadium into raptures.
The Poles will play Croatia or Portugal for a berth in the semis.
Jakub Blaszczykowski gave Poland a 39th-minute lead before Xherdan Shaqiri equalised with a spectacular bicycle kick in the 82nd to send the match into a dramatic climax.
Poland should have gone ahead inside the first minute when Arkadiusz Milik sent his shot over a gaping goal following a calamitous defensive mix-up.
Poland striker Robert Lewandowski was subdued in the first half but his team created chances thanks to livewire left winger Kamil Grosicki and equally good work by Blaszczykowski on the other flank.
Swiss captain Stephan Lichsteiner could not keep up with Grosicki, who fired over the bar from 18 metres.
Blaszczykowski broke the deadlock with a composed finish from 10 metres after a darting run by Grosicki and a clever dummy from Milik gave the winger time and space to pick his spot.
With playmaker Xherdan Shaqiri and striker Haris Seferovic totally stifled by Poland’s rock-solid defence, Switzerland created little up front in the opening period despite roaring “Go Suisse” chants by their supporters.
The Swiss came out with renewed purpose in the second half and Shaqiri finally showed a glimpse of his immense talent with a dazzling solo run and a stinging shot which goalkeeper Lukasz Fabianski parried.
Blaszczykowski had Yann Sommer at full stretch as the pace increased with Switzerland throwing men forward.
Shaqiri produced a moment of magic with one of the best goals of the tournament in the 82nd minute, twisting his body in the...