In the aftermath of one of his finest losing performances – in three sets of rolling intensity against his greatest rival, Rafael Nadal – Roger Federer was sanguine about his immediate and long-term future on the eve of the US Open, even though he is about to be pushed down now to No7 in the world rankings.

"I'm not totally unhappy about the match," said the former world No1, who has won 17 grand slam titles but has a decreasing chance of adding to that number after Nadal's 5-7, 6-4, 6-3 win in their 31st encounter to advance to the semi-finals of the Cincinnati Open. Federer had the Spaniard at his mercy for a long time in the middle of the match – and saved four match points at the end – but he could not find the strength to hold him off.

"It's a match, that's all," Nadal said. "But always the emotions are there when we play each other." It was that and more in Mason, Ohio.

The number of spectacular saves and winning shots left the audience gasping at times. Nadal plays Tomas Berdych, who beat Andy Murray handily in two sets, and the American John Isner, who put Novak Djokovic out in three sets, faces the Argentinian Juan Martín del Potro, a more convincing winner over the Russian Dmitry Tursunov.

"Credit to him for hanging in there, for getting back tough shots and probably making me hit the extra ball," Federer said. "Could have won tonight, should have won tonight, who knows? But, at the end, I think Rafa's confidence and the way he's playing at the moment got him through. My mind's already totally geared into what I'm going to do tomorrow, next day, and the following day, and looking ahead at the US Open. So I'm excited about the next 10 days."

Nadal has now won 51 of 54 matches – including 13 on hard courts – since returning from seven months out injured after losing in the first round at Wimbledon last year to Steve Darcis. It has been as staggering a comeback as Federer's gradual decline has been perplexing. Both played some exhilarating tennis on Friday, Federer's purple patch arriving in mid-match before Nadal rallied to level at a set apiece then imposed his dominance in the concluding set.

The shots flowed from both sides of the net from start to finish and Federer reached such a peak of excellence in the second set it was hard to imagine he would not carry this form into the US Open, which starts on Monday week.

Nadal, who is close to sealing his 37th Masters 1000 title, will start a warm favourite against Berdych, who has won only two sets in their past 13 matches, a rivalry in which Nadal leads 14-3. The underlying drama of the day resided with Federer, who is slipping further away from the leading pack by the day. "I'm happy with my progress," he maintained, despite a marked dip in form here. "I know my body's fine and my mind's OK, so that's two good things looking ahead. My movement started to be better, with more intensity, I started to put more balls inside on the return, and I started to have more control of the ball from the baseline with my forehand, something that didn't happen in the first set and a half.

"I can definitely take more things away from this week than I could for the last three months," he added, looking back on a woeful run of form against outsiders since losing at Wimbledon to the little-known Sergiy Stakhovsky.

Federer insisted that dropping down the world rankings does not disturb him. "It doesn't change anything for the US Open," he said. "For after that, as long as you're either in the top four or the top eight, at this point that's what matters. Or you're world No1. So rankings at this point anyway are not what lead me. It's about getting my game back on track and that's what I'm doing well. That's what's exciting right now, not the rankings really." Easily said, tougher to ignore.

As for Nadal, he seems to be in good form and even better mood. His view of the rankings also seems to add up: "In my opinion, he [Federer] played a very bad match [on Thursday]. I saw him play then with a lot of mistakes and in this match he was on court with a different tactic, with a different level of tennis. So if he is able to play this way – and I'm sure he will be able to do it – I see his ranking as going to be higher at the end of the season."