The loss denied Serena the chance of winning a record-equalling 24th Grand Slam singles title on home soil this year.
Azarenka will now face Japan’s Naomi Osaka on Saturday in her third final at Flushing Meadows, having lost the previous two to Williams in 2012 and 2013.
Azarenka said her mental game had been crucial in beating the 38-year-old Williams, who needed a medical timeout to have her left ankle re-taped in the third set due to Achilles trouble.
“I have been working on finding a calm mind and keep the body going,” the Belarusian said in an on-court interview.
“She dug me in a big hole in the first set. I needed to find energy to climb out of the hole and it wasn’t easy.”
Six-times U.S. Open champion Williams came out firing winners from all sides of the Arthur Ashe Stadium court.
While Azarenka struggled with her serve, committing four double-faults in the first set and winning just six of 15 first-serve points.
She also had 10 unforced errors and appeared increasingly frustrated, with a mic catching her muttering a pair of expletives at herself before Williams took a 4-1 lead.
Williams wrapped up the opening set in little more than half an hour.
But Azarenka seized momentum in the second frame, breaking the third seed’s serve with a pair of backhand winners from the baseline to take a 3-2 lead.
Playing her first Grand Slam semi-final in seven years, Azarenka got the better of Williams in some explosive exchanges of power-hitting while her serve also saw major improvement.
The 31-year-old took the set to force a decider after winning nearly 75 percent of her first-serve points and committing just one unforced error.
The twice Australian Open champion kept up the pressure in the third.
She looked to be in a deep meditative state as Williams had her ankle taped, not even reacting as an insect landed on the bridge of her nose as she waited to resume the match.
Azarenka then sealed her place in the final with an ace.(Reuters/NAN)