Switzerland produced an incredible comeback with three goals in the final 10 minutes to defeat Slovenia 3-2 at St. Jakob-Park.
Goals from Milivoje Novakovic and Bostjan Cesar either side of half-time looked to have set Slovenia on the way to a crucial victory in the battle to join runaway Group A leaders England at Euro 2016 in France.
However, substitutes Josip Drmic (80) and Valentin Stocker (84) turned the match around, before Monchengladbach forward Drmic struck a dramatic winner in stoppage time to spark wild celebrations, led by coach Vladimir Petkovic on the touchline.
Switzerland had started brightly, as Slovenia goalkeeper Samir Handanovic produced a point-blank save when Timm Klose touched on a free-kick by Xherdan Shaqiri, the Stoke midfielder.
The hosts, though, failed to make the most of their dominance and were punished on the break in first-half stoppage time when Novakovic latched onto Josip Ilicic's pass and calmly lifted the ball over Swiss goalkeeper Yann Sommer.
Switzerland's task was made even harder at the start when Cesar headed in a corner on 48 minutes.
Just before the hour, Novakovic, who plays his club football in Japan at Nagoya, was carried off on a stretcher with what looked like a serious shoulder injury.
The home fans were left incensed on 63 minutes when captain Stephan Lichtsteiner charged down the right and appeared to be tripped just inside the penalty area by Dalibor Stevanovic.
However, Czech referee Pavel Kralovec instead awarded a free-kick against the Swiss skipper for diving - which saw tempers boil over and players become embroiled in a melee before order was restored, with cautions shown to both sides.
Switzerland, who head to Wembley to tackle England on Tuesday night, finally got back into the match when Drmic converted Breel Embolo's pass, and before Slovenia could regroup, Stocker had drilled in an equaliser after being set up by a clever cutback from Shaqiri.
With the Basel crowd roaring them on, the Swiss poured forwards, and Fabian Schar's header was beaten away by goalkeeper Handanovic.
However, deep into four minutes of added time, the ball was again swung into the Slovenia penalty area, where a deflection dropped right into the path of Drmic, who crashed the ball into the net from 10 yards before being swamped by a sea of red shirts.