(CNN) -- Novak Djokovic denied Roger Federer a men's U.S. Open final face-off against Rafael Nadal on Sunday.
The third-seeded Serb beat the five-time champion and second seed Federer 5-7 6-1 5-7, 6-2 7-5 to gain that spot.
"It's one of those matches that you will remember for the rest of your life," the U.S. Open's web site quoted Djokovic as saying.
"Not just because you won against one of the best players that ever played this game, but coming back from match points down and playing good tennis to win in the end. I am very proud of myself."
The match seesawed from the first set when Djokovic lost it despite a 4-2 early lead. The second set saw a complete turnaround when Federer lost six of seven games.
The third set saw the two men matching each other before Federer converted a breakpoint on Djokovic's forehand error.
The fourth set saw Djokovic break back twice to force a fifth set, which remained a nail-biter with Djokovic saving two match points by Federer before taking the set and the match.
Nadal meanwhile eased into his first U.S. Open final earlier Saturday with a 6-2, 6-3, 6-4 win over Russian Mikhail Youzhny.
The Spaniard had too much power and control for the tournament's 12th seed, winning in two hours 13 minutes.
"For me it is a dream to play for the first time in a final in the biggest center court in the world," said the 24-year-old Nadal, who lost in the semi-finals here for the last two years.
"I have been trying my best for years. so after a lot of work I am very happy about that.
Nadal reached the last four in New York for the third straight year without losing a set, and he had dropped serve just once in 77 service games.
The stakes were high for Nadal as he bid to reach the U.S. Open final for the first time at his eighth attempt.
A win here on Sunday would make him the seventh man in history, and the second youngest, to win all four Grand Slam titles -- Australian, French, Wimbledon and U.S. -- during his career.
It would also make him just the fourth man to win three consecutive Grand Slam titles in the Open era dating back to 1968.
Youzhny, a semi-finalist here in 2006, was bidding to reach his first Grand Slam final at the age of 28 and in so doing offer up the prospect of emulating Marat Safin, the first Russian to win the U.S. Open, doing so 10 years ago.
But in the end Nadal comfortably served out for his 20th consecutive Grand Slam match win after his title triumphs at the French Open and Wimbledon.
He now will have the chance of becoming the first man since Rod Laver in 1969 to complete the same-year hat-trick by winning the U.S. Open.