The highly anticipated match saw several momentum swings with Yastremska holding a 4-2 lead in the first set only to see Williams win five of the last six games to grab the lead.
After breezing through the second set, the final set saw a series of late breaks that went the Ukrainian's way and she closed out the match after two hours and 35 minutes of play.
Yastremska overcomes Williams in seesaw contest
Williams won the first six points before the Ukrainian rebounded to hold. She then held two break points and after bypassing her first chance, she converted on her second, a clean backhand winner down the line giving Yastremska a 2-1 lead.
After an exchange of holds at 30, Williams double-faulted to open her service game, the seven-time major champion flew a backhand long to give the 20-year old a break point which was erased with a good serve.
A forehand into the net gave Yastremska a second break point which was saved by a Williams ace out wide. A pair of forehand errors by the Ukrainian got the American out of trouble to stay within touch.
Williams' forehand began doing damage and after battling a long game, she broke when Yastremska's forehand sailed long to level the set at 4-4. The Ukrainian turned her ankle serving in the tenth game, but shook it off to hold for 5-5. An ace for Williams on game point put her back in front 6-5 and she broke to win the set after a rash of unforced errors for Yastremska.
A visit from the trainer before the second set to treat a blister on a toe on her left foot and to look at her right ankle, Yastremska raced out to a 0-30 lead in the opening game of the second set, but more outstanding serving by Williams got her out of trouble.
A double fault put the Ukrainian down 0-30 and a further error brought up triple break point for the American. A forehand winner and consecutive aces wiped away all three opportunities and she held after a near ten minute game.
The Yastremska forehand came alive in the next game and it helped her to a break for a 2-1 advantage. She attained a double break advantage after Williams double faulted to go ahead 4-1. Winners started coming off of the Ukrainian's racket and a forehand down the line gave her the set to even up the match.
The third set began with eight consecutive holds until Williams faltered with a pair of double faults and a meek slice backhand into the net on break point as Yastremska took a 5-4 lead. Undeterred, the American broke back as the world number 24 missed a forehand by inches.
A terrible game that saw Williams broken to love gave Yastremska a second chance to serve it out. Facing 15-40 after misfiring on a backhand, the Ukrainian saved both chances and after a 19-shot rally, erased a third. An ace set up match point and a final backhand into the net gave the Ukrainian a hard-fought victory.