Nadal had a disappointing tournament last time out in Madrid when he was surprisingly beaten by Dominic Thiem, meaning he dropped behind Federer in the world rankings at the start of this week.
The Spaniard knew he would need to win in Rome in order to regain his place, and was almost outdone by Zverev in the final.
Nadal looked at his very best in the first set with Zverev having no answer for some scintilating tennis from the 31-year-old.
But the German impressively fought back in the second set to take it to a decider and went a break up before rain caused a short delay in play.
Nadal came back rejuvenated from the break and swiftly broke Zverev’s serve before going on to win the match.
It means Nadal will now replace Federer at the top of the men’s rankings tomorrow morning heading into the French Open.
The Swiss tennis star will not compete at Roland Garros for the third consecutive year, meaning Nadal and Zverev will be the top two seeds.
Novak Djokovic could also prove a tough test in Paris after an impressive display in the Italian Open this week.
The Serbian has struggled since returning from injury but looked more impressive during his semi-final match against Nadal yesterday.