Roger Federer has finished off a 7-6 (4), 4-6, 7-6 (5), 6-4 win over friend and fellow Swiss player Stan Wawrinka to reach the French Open semifinals.

It sets up the 39th career meeting between Federer and longtime rival Rafael Nadal.

Nadal advanced to a record-extending 12th Roland Garros semifinal earlier on Tuesday with a 6-1, 6-1, 6-3 win over Kei Nishikori.

"I'm very satisfied, it's incredible, lots of emotions," Nadal said. "To be back in the semifinals is something very, very important."

Nadal has won all five meetings with Federer at Roland Garros.