Brad Binder stole his debut Moto2 pole away from Marcel Schrotter with a late lap in Aragon Grand Prix qualifying to go 0.074 seconds quicker.
Just two weeks after taking his maiden grand prix podium, Intact GP's Schrotter placed his bid for a debut pole by setting the pace with a 1:53.246s in the opening stages of qualifying.
Gresini's Jorge Navarro put Schrotter under pressure, but missed out on top spot by just 0.011s, while Schrotter moved the goalpost slightly 15 minutes later with a lap of 1:53.223s.
Despite a crash at Turn 6 in the early stages, Alex Marquez jumped up to third midway through the session with an identical 1:53.257s to Navarro to get to within 0.034s of Schrotter's time.
Schrotter's 1:53.223s looked like it would remain the pole time, but KTM's Binder snatched it away from the German with a 1:53.149s set in the final two minutes of the session.
Binder's time came under no threat as the chequered flag came out, the South African taking his first grand prix pole since the Moto3 Valencia race in 2016, and the first for his nation in the intermediate class since 1980.
Schrotter held onto second, with Navarro completing the front row for his best qualifying result of the season.
Marquez will head row two despite his early tumble on the leading Marc VDS bike, while teammate Joan Mir struggled in 15th.
The second Ajo KTM of Miguel Oliveira showed nothing like the pace of Binder in qualifying, and will start his assault on Francesco Bagnaia's points lead from a lowly 18th.
Bagnaia will line-up alongside Marquez on his Sky VR46 machine, while Italtrans' Mattia Pasini completes row two.
Fabio Quartararo was denied a place on the second row by just over a tenth, while Lorenzo Baldassarri, Simone Corsi and Luca Marini rounded out the top 10.
Pons' Augusto Fernandez was the only other faller in the session, the Spaniard coming off at Turn 15 midway through the session. Fernandez held onto 11th despite this.