Gauff, 21, defeated the world number two in just 64 minutes despite never having defeated a Polish opponent on clay before.
In the final, American Gauff will face either Elina Svitolina or world No. 1 Aryna Sabalenka.
Swiatek, the defending champion, had won nine straight games in Madrid and 15 of 16 since losing to Sabalenka in the 2023 final, but she was helpless against Gauff.
In a commanding performance, Gauff, the 2023 US Open champion, smashed seven aces and won 19 of 21 games on her first serve.
“I played with margin and was aggressive. In her on-court interview, Gauff stated, “Perhaps it wasn’t her best level.”
Dayana Yastremska was defeated by the American in three sets.