Serena Williams holds up the championship trophy after defeating Victoria Azarenka for the U.S. Open women’s singles championship Sunday in New York. (AP Photo)

NEW YORK — Fussing with her skirt and flubbing her shots, Serena Williams was troubled in the U.S. Open final by the swirling air and the strong play of Victoria Azarenka.

After one miss, Williams declared: “I can’t play in this wind.” After blowing a big second-set lead, Williams chucked her racket toward the sideline, and it bounced back onto the court.

In the end, Williams pulled herself together, as she usually does when it matters the most. Facing her only test of the past two weeks, the No. 1-seeded Williams overcame No. 2 Azarenka 7-5, 6-7 (6), 6-1 on Sunday for a fifth championship at Flushing Meadows and second in a row.

Williams, who turns 32 on Sept. 26, raised her Grand Slam singles title count to 17, the sixth-most in history and one shy of Martina Navratilova and Chris Evert. Williams collected a $3.6 million prize, including a $1 million bonus for producing the best results during the North American summer hard-court circuit leading up to the U.S. Open.

Helped by nine aces, one at 126 mph, Williams improved to 67-4 with a career-best nine titles in 2013. Since a first-round exit at the 2012 French Open, Williams is 98-5 with 14 titles, winning four of the past six Grand Slam tournaments.

“Vika’s such a great opponent, such a great fighter,” Williams said, “and that’s why she’s been able to win multiple Grand Slams. That’s why it was never over until match point.”

Yes, this one did not come easily, even though it appeared to be nearly over when Williams went ahead by two breaks at 4-1 in the second set. Williams served for the match at 5-4 and 6-5 — only to have the gutsy Azarenka break each time.

This was a rematch of last year’s final, also won by Williams in three sets, and two-time Australian Open champion Azarenka provided another challenge with her big swings off both wings.

“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, who is from Belarus. “I gave it all today. We showed our hearts. We fought hard.”

Four times, Azarenka was only two points from taking the opening set. At one such moment, with Williams serving at deuce after a double-fault, she was called for a foot fault, erasing what would have been a 121 mph ace. There was another foot-fault call in the second set, too. They brought back memories of the American’s loss to Kim Clijsters in the 2009 semifinals, when Williams was docked a point, and later fined, for a tirade against a line judge over a foot-fault call.

There was no such outburst directed at officials this time, although there was that racket toss. After the call in the match’s 10th game, Williams simply put a hand to her face, composed herself, and won the point with a down-the-line backhand she celebrated with a fist pump, some foot stomping and a yell of “Come on!”

Williams wound up holding there with a 104 mph ace, part of what seemed to be a match-altering stretch. She won five consecutive games and 16 of 18 points to take the first set and go up a break in the second.

Her lead grew to 4-1 in the second set, before Azarenka made things competitive again. Azarenka is responsible for two of Williams’ four losses this season. And entering Sunday, Azarenka was 31-1 on hard courts this season, and she showed why for portions of the final, playing far better than she had in her preceding six matches in New York.

But she simply could not keep pace with Williams, who eventually adjusted to her opponent and the wind that topped 15 mph. Williams put aside her issues to finish with a 36-17 edge in winners.

The first time Williams served for the championship, at 5-4, Azarenka hit a cross-court forehand winner for break point, then forced a backhand long. Williams came right back to break for a 6-5 edge. But on her second chance to serve it out, she double-faulted to get broken for the fourth time Sunday.

A year ago, they played the first three-set women’s final in New York since 1995. And they went the distance again, a total of 2 hours, 45 minutes, because Azarenka was superior in the tiebreaker.

When it came time to close the deal, Williams shined. She has six of the eight winners in the third set, forced Azarenka into 15 miscues, and soon enough, was hopping up and down after finishing with a service winner.

Azarenka faltered late, the way she did when losing the last four games in the 2012 final. She hit two of her seven double-faults while getting broken to 3-1 in the third set, then could only watch as Williams hit a pair of aces in the next game.

No. 1-seeded Novak Djokovic faces No. 2 Rafael Nadal in the men’s final Monday. It’s the first time since 1996 that both U.S. Open singles finals are 1-vs.-2 matchups.

On Sunday, with former President Bill Clinton among the announced crowd of 23,584 in Arthur Ashe Stadium, and Williams’ older sister Venus in a front-row seat, the fans were largely cheering for the American.

“I definitely felt the love,” Williams said, “so thank you all so much for the support.”

The breeze was clearly a factor at the outset.

Williams would catch her service tosses. She would try to stop her skirt from flapping around. And, most importantly, she would be caught off-guard by the balls that danced oddly. Six of the first 16 points ended with unforced errors by Williams, which allowed Azarenka to go ahead 2-1.

Looking hesitant at times, Williams did not show the same dominance she had while dropping only 16 games during six straight-set victories through the semifinals. And while she did go ahead, Azarenka made things interesting with a hard-hitting comeback.

Wasn’t quite enough.

Williams equaled Steffi Graf with five U.S. Open titles, one behind Evert’s record of six in the Open era, which began in 1968. Williams never had won two consecutive U.S. Opens, but now she has, adding to the trophies she earned in New York in 1999 — at age 17 — then 2002 and 2008.

Those go alongside five from Wimbledon, five from the Australian Open, and two from the French Open, which she won this year.

Williams also became the first woman to surpass $9 million in prize money in a single season, while topping $50 million for her career.