player from each group advancing into the semifinals.
Williams, ranked 11th dropped her serve to open the match before falling behind 2-5 in set one.
Keys, ranked 19th, then quickly powered to a one set lead before Williams steadied her game to take the first two games of set two.
Williams continued her improved play to take set two leads of 3-1 and 5-3.
Serving to stay in the set, Keys held serve at love to reach 4-5.
Then serving for the set, Williams netted a crosscourt forehand to end a 21 shot rally and fall behind 0-15.
A Keys down the line forehand return winner followed by two Williams forehand errors leveled the set at 5 games all.
Keys held serve to lead 6-5.
Serving to stay in the match, Williams struck aggressive groundstrokes on two consecutive points which forced errors from Keys and resulted in a 30-0 Williams lead.
Keys then struck a down the line backhand return winner followed by a crosscourt forehand winner to level the game at 30 all and put her two points from the upset win.
However powerful serving from Williams put the American into the tiebreaker as Keys struck a crosscourt backhand return wide on gamepoint.
Williams raced to a 4-2 tiebreak lead behind two powerful down the line forehands before Keys netted a crosscourt backhand to end the set on set point two.
Keys delivered an increasing number of errors in the final set as Williams continued her sterling play to score two breaks of serve to lead 4-0.
Then mixing in some experience into her power game, Williams struck several consecutive clever slice serves to save break point and hold serve to lead 5-0 after winning her 7th game in a row after trailing in set two 5-6.
Keys held serve to take her lone game of the final set before Williams served for the match.
Keys struck a crosscourt backhand long to trail 15-0 before hitting an inside out crosscourt forehand winner to level the game score at 15 all.
Then two powerful Williams serves forced return errors from Keys as Williams reached match point.
Keys netted a crosscourt backhand return to end the match.