NEW YORK (AP)—The only other time Mikhail Youzhny reached the U.S. Open semifinals, in 2006, he got there by upsetting Rafael Nadal.

So guess who might be waiting for Youzhny now that he is back in the final four at Flushing Meadows? That’s right: Nadal.

The 12th-seeded Youzhny hit fewer aces and fewer winners, needed treatment on his right foot in the fifth set—and still managed to come back and beat 25th-seeded Stanislas Wawrinka of Switzerland 3-6, 7-6 (7), 3-6, 6-3, 6-3 in four hours Thursday.

“Maybe I was just a bit luckier than him,” Youzhny said.

On Saturday, the 28-year-old Youzhny will play in his second career major semifinal against No. 1-seeded Nadal or No. 8 Fernando Verdasco, who were scheduled to play in the first all-Spanish quarterfinal in U.S. Open history later Thursday. Nadal took a 10-0 head-to-head record over Verdasco into that match.

In the semifinal on the other half of the draw, No. 2 Roger Federer will face No. 3 Novak Djokovic. They won their quarterfinals Wednesday.

Four years ago, Russia’s Youzhny was unseeded at the U.S. Open, but he knocked off four seeded players, including Nadal in the quarterfinals, before losing to Andy Roddick in the semifinals.

Wawrinka was only the second seeded player Youzhny has faced in the tournament this year; he beat No. 18 John Isner of the United States in the third round.

Nothing seemed to rattle Youzhny on Thursday. He dealt with a deficit, a problem with his right foot, and more of the swirling wind that’s plagued the tournament. The wind was gusting at more than 15 mph, there were ominous gray clouds overhead, and the temperature was in the upper 60s.

That wind made it tough to control strokes, and Wawrinka made 71 unforced errors, Youzhny 57. That helped Youzhny overcome Wawrinka’s advantages in aces (13-2) and winners (48-35). Both men won 154 points.

Youzhny also never appeared to get rattled by all the noise going on near the court as Wawrinka was supported exuberantly by his entourage. On pretty much every significant point won by Wawrinka, the black-clad, sunglasses-wearing bunch in his guest box would stand up, applaud, yell and trade fist bumps. The celebrations were led from the front row by Wawrinka’s coach, Peter Lundgren— who used to work with Federer and helped him win his first Wimbledon championship.

Wawrinka never had been past the fourth round at a Grand Slam tournament before this one. He is best known—if known at all—for being countryman Federer’s doubles partner at the 2008 Beijing Olympics, where they won the gold medal.

Yet Wawrinka upset No. 4 Andy Murray, a two-time major finalist, in the third round, then followed that up by beating No. 20 Sam Querrey, the last American man in the field. But Wawrinka sought treatment for a bothersome left leg in the fourth set Thursday and faded.

There were plenty of ebbs and flows of momentum, with neither player able to get on a prolonged roll until the end. Each of the first three times Youzhny broke Wawrinka—seemingly wresting control of the first set, then the second— he was broken right back in the very next game.

After Youzhny took the second-set tiebreaker with a cross-court forehand passing winner and a big inside-out forehand that forced a backhand error, he immediately fell behind 3-0 in the third set.

After Wawrinka claimed the third set, he immediately fell behind 3-0 in the fourth, then had a trainer tape up his left thigh during a changeover. Wawrinka began the match with a bandage on his right thigh, which began bothering him during the victory over Murray.

In the last game of the fourth set, Youzhny hit a well-disguised drop shot, and as Wawrinka went to chase it down, his left foot slid out from under him. Wawrinka fell and stayed down at the baseline, rolling on his back and covering his face with both arms. On the next point, Wawrinka missed a backhand and spiked his racket on the court.

Youzhny served out that set, then broke right away at the start of the fifth. But, in keeping with the pattern, Wawrinka broke back to 2-all, thrusting his racket overhead and shaking it vigorously after Youzhny sailed a backhand long.

Play was delayed for about five minutes after that game while a trainer worked on Youzhny’s right foot. And when they resumed, Youzhny broke right back to go ahead 3-2. He broke again in the final game, with Wawrinka making errors on the last three points.

That let Youzhny celebrate in his unique way, turning to the stadium’s four corners, placing his racket on his head and saluting with his other hand.