Updated

Roger Federer sure gave Novak Djokovic chances, all sorts of chances, to pull off a major surprise in the U.S. Open final Sunday.

Federer knows how to win these things, while Djokovic is still learning, and that might have made the difference. Hardly at the top of his game, Federer came through, beating Djokovic 7-6 (4), 7-6 (2), 6-4 for his fourth consecutive U.S. Open championship and 12th Grand Slam title overall.

The 26-year-old Federer became the first man since Bill Tilden in the 1920s to win the American Grand Slam four years running, and he moved within two of Pete Sampras' career record of 14 major titles.

Djokovic was in his first Slam final, yet he led 6-5 in each of the opening two sets. In the first, the 20-year-old Serb held five set points. In the second, he held two.

Federer erased all of those, showing the craft and cool that have allowed him to hold the No. 1 ranking for the past 188 weeks, the longest run by a man or woman.

About the only category Djokovic won on this day was "Most Intriguing Guests," with 2006 Open champion Maria Sharapova and actor Robert De Niro sharing a box with his parents in the stands.

Federer — dressed for an evening on the town, he was all in black, from headwrap and wristband to socks and shoes, from shirt to shorts with tuxedo-like satin stripes down the side — finished things under the lights by breaking Djokovic in the last game with the help of a no-look, over-the-shoulder volley winner.

It's the type of shot that has prompted plenty of people to call Federer the greatest to ever swing a racket — and he's still in his prime.

The No. 3-ranked Djokovic might be younger, but he was the one breathing heavily midway through the first set, standing in place and beckoning a ballkid to bring him a towel so he could rest a bit after a 16-shot point.

Federer was hardly the Federer everyone has to come to expect, and when he double-faulted, then sprayed two forehands long, Djokovic had the first break of the match, going up 6-5. Perhaps thinking they'd be witnesses to an upset, many in the crowd got on their feet, clapping and screaming.

So Djokovic served for the first set and raced out to a 40-love edge.

Three set points. Three chances to take a one-set lead against Federer in the U.S. Open final.

And just like that, they vanished: Federer hit a cross-court forehand winner that caught a line, and Djokovic missed two backhands.

Then came a fourth set point, but Djokovic sent a forehand long.

Then a fifth, but Federer smacked a forehand return that landed right on the baseline and Djokovic's stab backhand went long.

After Djokovic missed yet another backhand to give Federer his first break point of the match, the Serb's nerves really got the better of him: He double-faulted.

That sent the set to a tiebreaker, where there was more of the same. Of Federer's seven points, two were courtesy of double-faults and two were thanks to backhand errors by Djokovic.

It might take some players years to recover, if at all, from that sort of collapse, but Djokovic needed about 15 minutes to grab a 4-1 lead in the second set. Once more, Federer asserted himself, breaking back at love to get within 4-3. And when Federer served while trailing 6-5, Djokovic earned two set points.

Naturally, Federer took care of the first with a 126 mph ace, and Djokovic blew the next with an errant forehand.

Again they went to a tiebreaker, and again Federer was better. When he ended it with a backhand passing winner down the line — placing the ball through the one, tiny opening there was — Federer skipped toward the sideline, screamed and punched the air.

Djokovic had one last opportunity to climb back into the match, getting to love-40 when Federer served at 2-2 in the third set. But Djokovic sailed a backhand return long, let a Federer forehand skim off the baseline to end a 15-stroke exchange, then put a backhand return in the net. That brought it to deuce, and Federer took the next two points to hold.

That was part of Djokovic's 2-for-9 futility on break points. And Federer? Well, all he did was earn five break points — and convert three.