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.

“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.

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.”

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.

Williams 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.

But she simply could not keep pace with Williams, who 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.

When it came time to close the deal, Williams shined. She had 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.

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.”

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.