The gold medal was the first ever for Spain in Olympic tennis.
Nadal was already assured of taking over the No. 1 ranking Monday for the first time, ending Roger Federer's reign after 4 1/2 years. Nadal has won 38 of his past 39 matches, including victories over Federer in the finals at the French Open and Wimbledon.
"Nowhere in my best dreams I can imagine something like what I did this year," Nadal said. "I know how difficult it is to win these things, and especially here, because you only have one chance every four years."
Elena Dementieva earned the gold in women's singles, taking advantage of 17 double-faults by fellow Russian Dinara Safina to win 3-6, 7-5, 6-3.
In women's doubles, Venus and Serena Williams of the United States won the gold, beating Anabel Medina Garrigues and Virginia Ruano Pascual of Spain 6-2, 6-0. The sisters celebrated with shrieks, then shared a hug.
Men's singles has traditionally been an upset-filled event at the Olympics, and Nadal is the first player ranked in the top five to win the gold.
He took charge against Gonzalez from the start, breaking serve in the second game. Nadal didn't face any break points until the 12th game of the second set, when he was down 5-6, 15-40.
Gonzalez failed to convert the set points, pushing a volley wide and putting a forehand in the net. The Chilean made five unforced errors in the tiebreaker to give Nadal a commanding lead.
Nadal ripped a backhand passing shot to break at love for a 3-1 lead in the final set, and erased two more break points to hold for 5-2.
He needed four match points to close out the victory, ripping one last forehand that Gonzalez barely could reach. Nadal collapsed to his back in jubilation.
Men's singles has traditionally been an upset-filled event at the Olympics, and Nadal is the first player ranked in the top five to win the gold. He stayed in the athletes' village and said the experience rejuvenated him.
"I arrived very tired," he said. "The reason probably I won this title is because I have a fantastic time here enjoying a lot in the village. That was amazing experience for me. Always was a pleasure to know new people, no?"
The No. 5-seeded Dementieva closed out her victory with a forehand winner, then fell to her knees before walking to net for a congratulatory hug from Safina. Dementieva, who won the silver medal at Sydney in 2000, snapped Safina's 15-match winning streak.
"I never expected a medal - gold, silver or bronze," said Dementieva, 26. "It's unbelievable. For me this is the best moment in my career. I'll never forget it."
Dementieva has been plagued for much of her career by a shaky serve, but it was a frustrated Safina who struggled to put the ball in play. After double-faults she flung her racket, banged it against the concrete and smacked a ball into the stands, but the tantrums failed to help.
Russia swept the medals in women's singles when Vera Zvonareva beat Li Na of China 6-0, 7-5 to win the bronze. That victory made Russia the first nation to win all three medals in one tennis event since Great Britain did so in the 1908 women's singles.
Tennis was not a medal sport between 1924 and 1988.
The Williams sisters improved their lifetime Olympic doubles record to 10-0. They won the doubles gold at Sydney but didn't play in Athens four years ago because Serena was hurt.
"It does mean more for me to win it with Serena, to share this kind of moment with your sister," Venus said. "I mean, we are practically joined at the hip."
Yan Zi and Zheng Jie of China beat Ukraine's Alona and Kateryna Bondarenko for the bronze, 6-2, 6-2.
The women's singles final began with only about a thousand spectators in the 10,000-seat stadium, but it was mostly full by the end 2 1/2 hours later.
Safina said she felt the toll of playing nine matches - three in doubles - in the past week.
"I was not the freshest today physically," she said. "To serve, you have to push yourself up, to jump up. And when the legs are a little bit slow, it just doesn't go."
In the final set, Safina broke her racket when she double-faulted three times to lose serve and fall behind 3-1. She served with a chance to reach for 4-all but committed four unforced errors and her final two double-faults.
Dementieva then served out the victory to complete the best week of her career. She beat eight-time Grand Slam champion Serena Williams in the quarterfinals.