Serena Williams of the U.S. celebrates after defeating Victoria Azarenka of Belarus in their women's singles finals match at the US Open. Photo: REUTERS

Finally tested, even trailing, at the U.S. Open, Serena Williams turned things around just in time.

Two points from defeat, Williams suddenly regained her composure and her strokes, coming back to win the last four games and beat top-ranked Victoria Azarenka 6-2, 2-6, 7-5 on Sunday night for her fourth championship at Flushing Meadows and 15th Grand Slam title overall.

“I honestly can’t believe I won. I really was preparing my runner-up speech, because I thought, `Man, she’s playing so great,” Williams said during the trophy presentation after the 2-hour, 18-minute match, adding: “I’m really shocked.”

Might be the only one.

After all, what really was stunning was that Azarenka made things as interesting as they were, given that she came into the day 1-9 against Williams over their careers.

Add in that Williams hadn’t dropped a set in the tournament, losing only 19 games through six matches before Sunday. All part of a tremendous run she is putting together in reaction to her loss at the French Open in late May, the American’s only first-round exit in 49 career major tournaments. Since then, she is 26-1, winning Wimbledon and the London Olympics.

There hadn’t been a three-set women’s final in New York since 1995, and Williams came through with a late charge to become the first woman to win Wimbledon and the U.S. Open in the same season since a decade ago, when — yes, that’s right — she did it.

“Serena deserves the win. She showed how true of a champion she is,” said Azarenka, who managed only 13 winners, 31 fewer than Williams. “I definitely gave it all today. Stepping out of this court today, I will have no regrets.”

Azarenka hadn’t dropped a three-set match all season until Sunday, going 12-0 in matches that went the distance, including victories over defending U.S. Open champion Sam Stosur in the quarterfinals and 2006 champion Maria Sharapova in the semifinals.

As the third set commenced, Williams’ mother, Oracene Price, told her from the stands, “Settle down.”

Didn’t happen right away.

When Williams double-faulted, slapped a bad backhand into the net and pushed a forehand long, Azarenka broke at love for a 4-3 edge, then followed that up by holding for 5-3.

One game from the championship.

Azarenka was two points away at 30-all with the fourth-seeded Williams serving in the next game, but couldn’t convert. And when Azarenka served for the victory at 5-4, she showed the jitters that probably are understandable given that this was only her second career Grand Slam final, 17 fewer than Williams.

Azarenka made three errors in that game, including a forehand into the net that let Williams break her to 5-all. Williams kept whatever excitement she might have felt contained, face straight as possible, while her older sister, seven-time major champion Venus, smiled and clapped in the stands.

That was during a key stretch in which Williams took 10 of 12 points to go ahead 6-5. She then broke again to win, dropping onto her back on the court when Azarenka sent a backhand long to end it.

Azarenka slumped in her changeover chair, a white towel covering her head, as Williams kept saying, “Oh, my God! Oh, my God! Oh, my God!” while scurrying over to share the joy with her mother and big sister.

Williams, who turns 31 on Sept. 26, is the first 30-year-old woman to win the U.S. Open since Martina Navratilova in 1987.

Williams dominating the game right now. And she’s been dominant, off and on, for more than a decade.

She won her very first major championship at age 17 at the 1999 U.S. Open. Winning titles 13 years apart at the same Grand Slam tournament represents the longest span of success in the professional era, which began in 1968. Navratilova (Wimbledon, 1978 and 1990) and Chris Evert (French Open, 1974 and 1986) had the longest previous spans of 12 years.

In the men’s final Monday, defending champion Novak Djokovic of Serbia will face Olympic champion Andy Murray of Britain. It’s the fifth consecutive year the tournament will conclude on Monday instead of the scheduled Sunday because of bad weather.

Djokovic beat David Ferrer of Spain 2-6, 6-1, 6-4, 6-2 in a semifinal that was halted in the first set because of impending rain Saturday and wrapped up Sunday.

Worries about a potentially dangerous storm led the tournament to postpone Williams-Azarenka, making this the fourth time in the last five years that the U.S. Open women’s final was pushed from Saturday to Sunday.

When they got started, Williams was good as can be, compiling a 16-2 advantage in winners through the first set.

She pounded big serves — she finished with 13 aces, at up to 125 mph — and big returns; smacked forehands and backhands out of Azarenka’s reach; even tossed in a terrific backhand lob to break for a 2-0 lead at the outset.

Both women had issues with the officiating — though nothing compared to Williams’ misadventures in the past.

In the 2009 semifinals, Williams was angered by a foot-fault call that resulted in a double-fault, setting up match point for her opponent, Kim Clijsters. Williams launched into a racket-brandishing tirade that resulted in a fine and a Grand Slam probation that made her be on her best behavior or risk being suspended. Then, while losing to Stosur in last year’s final, Williams lost her cool and berated the chair umpire — “You’re just unattractive inside,” was among the noteworthy lines — after being docked a point for screaming during a point.

This time, there was a foot-fault call, too. It came with Williams serving at 40-love while trailing 2-0 in the second set. She didn’t react at all immediately, finished off that game, then stared down the linesman as she walked to the sideline at the ensuing changeover. He chuckled a bit.

By that point, Williams had bigger problems to worry about.

She double-faulted to get broken in that set’s opening game, and got broken again to fall behind 4-1 in a game that featured Azarenka sliding into a running forehand winner and nearly doing a full splits. Even Williams applauded that one.

But when the game ended, Williams slapped her racket against her changeover chair.

Azarenka also had a minor run-in with the chair umpire Sunday, complaining when a point she thought she should have won was replayed.