The Spaniard recorded the biggest win of her career as Barty committed 55 unforced errors in the match to become the first top seed in Olympics history to lose in the opening round.
World number records shock win in straight sets
Sorribes Tormo was on the front foot right away as Barty duffed a backhand volley to bring up triple break point and a forehand long handed the advantage to the Spaniard.
She would gain a second break and go in front 4-1 before the top seed clawed one break back, but after saving a pair of break points to go in front 5-3, Sorribes Tormo took the opening set on her third chance when Barty pushed a backhand long.
Breaks were traded to begin the second set and later on, Sorribes Tormo saved a pair of break chances in the sixth game to level the set at 3-3. That would prove to be crucial as the Spaniard broke for the fourth time when Barty floated a backhand slice into the net.
After holding to move within a game of the monumental upset, she held two match points only to watch as both were saved with winners by the world number one. Given a third chance, Sorribes Tormo converted when Barty flubbed a shot into the net.