Williams looked in ominously good form when she cracked a backhand cross-court to break in the opening game, but a couple of errors gave the advantage straight back.
Azarenka was dealing better with the gusting wind on Arthur Ashe Stadium and serving well, in marked contrast to Williams, who also had to cope with a skirt that was clearly not designed for such conditions.
Match time: 2hrs 45mins
1st serve %
1st serve win %
2nd serve win %
Serving to stay in the set at 4-5, a nervous Williams came up with a double fault and a foot fault, but fought her way out of trouble with two tremendous backhands and an ace.
The pressure suddenly switched to Azarenka and, now swinging freely, Williams hammered a cross-court forehand and a return at the second seed's feet to clinch the set in 58 minutes
Williams was on a roll and broke twice in the second set on her way to a 4-1 lead, but Azarenka regrouped and got one of the breaks back as the American endured more skirt issues and sent a forehand wide.
The champion still had the comfort of that second break - but faltered twice with victory in her sights.
A double fault and a wayward backhand saw the chance disappear at 5-4, and Williams missed with two backhands at 6-5 and then, to gasps from the 23,000 spectators, double faulted for a seventh time.
When Williams missed another backhand to offer up two set points in the tie-break, she swiped her racquet in anger, appearing close to tears, and despite seeing off the immediate danger, the pressure told and she sent a backhand long when facing a third set point.
Williams could see another Grand Slam title slipping away but she responded superbly to dominate the final set.
Serena can be the greatest - Azarenka
Azarenka had served for the title last year, so knew all about going into a decider against Williams, but at 2-1 down she double faulted on break point. When the American broke for the seventh time, the contest appeared all but over.
There was one more flutter of nerves for Williams when she netted on her first match point, but Azarenka put a backhand over the baseline moments later to send the American leaping deliriously in celebration after two hours and 45 minutes of tension.
"It is a tough loss, but to be in the final and play against the best player, who deserves to win today, it's incredible,'' said Azarenka.
"I gave it all today. We showed our hearts. We fought hard.''
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.