World number one Novak Djokovic beat Roger Federer in four dramatic sets to win his second US Open and 10th Grand Slam title.
The Serb won 6-4 5-7 6-4 6-4 in New York and will end the year with three of the four tennis majors.
Djokovic, 28, kept his nerve in front of a heavily pro-Federer crowd at Flushing Meadows.
The 34-year-old Swiss had been hoping to win his 18th major title and his first for three years.
In a raucous night session on Arthur Ashe Stadium, after the start of play was delayed by more than three hours because of rain, Federer looked to have a real chance in the third set.
However Djokovic broke the Federer serve six times and saved 19 of 23 break points as he battled his way to a 27th win in 28 Grand Slam matches this year.
'This year sweeter than ever'
Djokovic took another step towards joining the very best in history with a 10th major title, moving him within one of Bjorn Borg and Rod Laver in the all-time list.
Defeat by Stan Wawrinka in the French Open final in June means the Serb was just one win short of completing the first calendar Grand Slam in men's tennis since Laver in 1969.
|Most Grand Slam titles|
|17: Roger Federer|
|14: Pete Sampras, Rafael Nadal|
|12: Roy Emerson|
|11: Rod Laver, Bjorn Borg|
|10: Bill Tilden, Novak Djokovic|
"It's been an incredible season, next to 2011 the best of my life," said Djokovic, who also won three Grand Slam titles four years ago.
"I'm enjoying this year more than I did any previous one because I'm a husband and a father, and that makes it sweeter."
Five-time champion Federer was playing his first US Open final since 2009, and drew one of the loudest cheers of the night when he told the crowd: "I'll see you guys next year."
The Swiss said it was "always tough" facing Djokovic, adding: "I think we both walk away from it knowing more about our games and more about each other.
"I'm pleased with where my game is at."
Defiant Djokovic takes New York
Federer came into the final having dropped serve just twice in the tournament and not having lost a set since Wimbledon, but Djokovic set about ruining those statistics.
The Serb made the sharper start, breaking the Federer serve twice in the first seven games and clinching the set after 41 minutes.
From then on, it was Djokovic's mental fortitude as much as his tennis that shone through as he turned the match around in the third set and held off a Federer comeback in the fourth.
After a tentative start, Federer had begun to move forward in the second set, at times deploying the net-rushing return - which has been called SABR ('Sneak Attack By Roger') - that he has developed this summer, only for Djokovic to keep finding a way past, or over, him.
The Swiss kept pushing, however, converting his fourth set point with a rasping backhand that delighted the majority of the 23,000 spectators.
|Djokovic is just the third man in the Open Era, which began in 1968, to reach all four Grand Slam finals in a calendar year, after Rod Laver in 1969 and Roger Federer in 2006, 2007 and 2009.|
Djokovic, now coping with occasional boos and shouts during his service motion, looked to be struggling after letting an early lead slip in the third, but he saved two break points at 4-4 and then wrestled the momentum back his way.
Federer, regretting the missed opportunity, let his guard slip and Djokovic pounced, forcing a backhand error to clinch the set.
With the momentum back with him, the top seed broke Federer twice to lead 5-2 in the fourth and then withstood another comeback as the Swiss earned three chances to level at 5-5.
The crowd was once again roaring the 17-time Grand Slam champion back into the match but Djokovic stood firm, seeing off the break points and defiantly clenching his fist when Federer floated the ball long on championship point.
Federer feels the love
The Swiss was playing in his seventh final in Arthur Ashe Stadium, but even he was taken aback by the support he received.
"They were unbelievable," said Federer. "Were they better than ever? Possibly."
The spectators were made to wait as the rain fell at Flushing Meadows, delaying the start time from 21:00 BST to 00:20, but quickly made their feelings known once play began by getting behind the former champion.
|Analysis from BBC Sport's Russell Fuller|
|This was another breathtaking display of resilience from Djokovic in the face of the most partisan crowd he has ever encountered in a Grand Slam final. The outcome could have been different if Federer had taken more than four of the 23 break points he created, but the Swiss was not able to rush this opponent in the way he did his others.|
|Since Rod Laver's 1969 Grand Slam, Jimmy Connors, Mats Wilander and Rafa Nadal have all won three Grand Slams in a single season, but only Federer - and now Djokovic - have done it at least twice.|
"It's so nice to feel that they want you to get back into the match, they want you to win, they're enjoying what they're seeing and getting their money's worth," he said.
"They were right there until I needed them at the very, very end."
Umpire shines on big night
Greek umpire Eva Asderaki was already having a good night, but the first woman to chair a men's US Open final got the biggest decision spot on.
Trying to convert a second break point as he attempted to stay alive in a dramatic third set, Federer fired a cross-court backhand that looked for all the world a winner.
However, the call of 'out' came from the chair and Hawk-Eye backed Asderaki's decision by the narrowest of margins.