Then ahead set point, the Spaniard struck a crosscourt backhand winner.
Azarenka powered to a 5-1 set two lead before leveling the match at one set all.
Badosa struck a 122 miles per hour ace down the tee in her opening service game of set three before holding serve then breaking serve to lead 2-0.
Azarenka broke serve at four games all to serve for the match at 5-4.
However, serving into the sun, Azarenka struggled on serve and struck four baseline errors to drop serve and reach five games all.
In the decisive third set tiebreaker, Badosa struck an overhead winner to open the tiebreaker before also striking a down the line backhand winner as well as a crosscourt forehand winner to lead 5-1.
The 23 year old Badosa then struck a crosscourt forehand winner on match point, her 44th winner of the day before falling to the court in celebration after three hours and four minutes of play.
In her best tour performances, Badosa this year reached the quarterfinals at both the Summer Olympics as well as Roland Garros.