Nadal broke Federer three times in the second set en route to a 6-4, 6-2 victory over the 17-time Grand Slam champion, who has been nursing a nagging back injury.
"I don't think Roger was 100 percent tonight," said Nadal, who nevertheless said the win over his great rival was a key step in his comeback from a seven-month absence while rehabilitating his damaged left knee.
"It was an important win for me," he said. "They all are now."
Nadal, the former world number one and winner of 11 Grand Slam titles, returned in February and notched one runner-up finish and two titles in a three-tournament Latin American clay-court swing.
But he hadn't tested his knee on hard courts since pulling out of the Miami Masters last March. He's the fifth seed in a field led by world number one Novak Djokovic, which also includes third-ranked Scot Andy Murray and second seed and 2012 champion Federer.
Nadal improved to 19-10 against Federer in a rivalry stretching back to 2004, which has included some epic clashes on the game's biggest stages. The pair had not met since the Indian Wells semi-final last year.
Nadal kept the pressure on Federer's serve in the opening set and earned the only break he needed in the seventh game for a 4-3 lead.
He secured the set with a service winner on his fourth set point.
In the second set he made effective use of his forehand and sped to a 3-0 lead with two breaks of serve.
Federer regained a break in the fourth game -- his first opportunity of the match -- but an uncharacteristic number of errors kept him from making further inroads and Nadal wrapped up the victory after one hour and 24 minutes when Federer netted a backhand.
"I played a fantastic first set," Nadal said. "The second set was strange. The second set I think Roger didn't fight as usual. Probably he had some problems and he didn't feel enough comfortable to keep fighting."
Nadal said he was encouraged by an improvement in his movement on the court, which he said was better than in his fourth-round win over Ernests Gulbis.
"I played much better than yesterday," he said. "So very happy, especially after a long match yesterday, to be able to compete well the next day."
Federer, meanwhile, said that while he clawed out a victory over Stanislas Wawrinka in the fourth round despite his aching back, Nadal had been too good.
"It's obviously a small issue," Federer said of the back trouble that he has received treatment for throughout the tournament. "That doesn't work against a guy like Rafa."
Federer now heads into a break of several weeks. He had already said he would not play the Miami Masters starting next week and currently plans to return at the Madrid Masters in May.
Nadal advanced to a semi-final showdown with sixth-seeded Czech Tomas Berdych, a 6-4, 6-4 winner over South African Kevin Anderson.
Berdych has reached the semi-finals without dropping a set and said his run in the first Masters tournament of the year was a morale booster.
"It feels great," the 27-year-old said. "It's the first Masters of the year, it's very important for me for the confidence."