The world number four and partner Marc Lopez edged out Romanian duo Florin Mergea and Horia Tecau on Saturday, earning the world number four his second Olympic medal following his singles triumph in Beijing in 2008.
"It was an amazing experience, especially doing that with one of my best friends, with Marc, it's something unforgettable for me, for both of us, I think," Nadal told reporters afterwards.
"Win a gold medal today after two months and a half with no practice, with no preparation at all, just working on the gym, is something that is a dream, no? The moment was unbelievable, and we had fun. We fight hard. The only thing that we can say is that we are very, very happy."
Nadal remains in contention in the singles competition, where he faces a potential final showdown with reigning champion Andy Murray.