Swiatek had been in imperious form in Melbourne, losing just 14 games across her five matches before the semi-finals.
For context, only three players in history have dropped fewer games in making the last four at the Australian Open in a 128-player draw during the Open era.
However, the four-time French Open winner was undone by an inspired Keys, determined to win an Australian Open semi-final at the third attempt.
A messy start featuring five breaks of serve in the opening six games set the tone for an awkward night under Rod Laver Arena roof for Swiatek, who broke for a fourth time to take the first set before capitulating in the second.
Keys took just 27 minutes to overwhelm Swiatek reeling off five straight games to force a deciding set.
Both players saved numerous break points as the tension ramped up during an enthralling, high-quality deciding set.
Swiatek eventually took her eighth opportunity to break for a 6-5 lead but, after failing to take her first match point, conceded serve with a double fault.
A winner-takes-all tie-break was what Keys and the match deserved but Swiatek looked to be in control of it at 7-5 up.
However, in a final impressive show of physical and mental resilience, Keys won five of the next six points to complete a sensational win after two hours and 35 minutes.