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 victory over his great rival was an important step in his comeback from a seven-month injury absence.
He returned in February and notched one runner-up finish and two titles in a three-tournament Latin American clay-court swing.
But Nadal hadn't tested his troublesome left knee on hard courts since pulling out of the Miami Masters last March.
Nadal improved to 19-10 against Federer in a rivalry stretching back to 2004 and including some epic clashes on the game's biggest stages.
But they hadn't met since their semi-final meeting here last year, which Federer won en route to his fourth Indian Wells crown.
Now the Swiss great is planning to take several weeks off. He had already said he wouldn't play in the Miami Masters that starts next week.
Nadal, seeded fifth, next plays sixth-seeded Czech Tomas Berdych, a 6-4, 6-4 winner over South African Kevin Anderson.