Steve Darcis of Belgium stunned the two-time champion 7-6 (4), 7-6 (8), 6-4. He ended Nadal's 22-match winning streak and eliminated one of the Big Four of men's tennis on the first day of the grass-court Grand Slam.
Nadal was sidelined for seven months with a left knee injury after losing in the second round of Wimbledon last year. He seemed to be struggling physically. He was unable to turn on the speed or use his legs to spring into his groundstrokes, limping and failing to run for some shots.
Darcis was as surprised as everyone else with the result.
"Rafa Nadal didn't play his best tennis today," the 29-year-old Belgian said. "The first match on grass is always difficult. It's his first one. Of course, it's a big win. I tried to come to the net as soon as I could, not play too far from the baseline. I think it worked pretty good today."
Nadal was coming off his eighth championship at the French Open last month but, on this day, he never looked like the player who has won 12 Grand Slam titles and established himself as one of the greatest players of his generation.
It's the second straight early Wimbledon exit for Nadal, who was ousted in the second round last year by 100th-ranked Lukas Rosol.
After that loss, Nadal took the rest of the year off to recover from the knee problem. Since returning to action this year, he had made it to the finals of all nine tournaments he entered, winning seven.
After winning the French Open, Nadal pulled out of a grass-court tuneup in Halle, Germany. He came to Wimbledon without any serious grass-court preparation.
Darcis is the lowest ranked player to beat Nadal at any tournament since Joachim Johansson — ranked No. 690 — defeated the Spaniard in 2006 in Stockholm.
Gustavo Kuerten, in 1997, was the last reigning French Open champion to lose in the first round at Wimbledon.
Darcis, who had won only one previous match at Wimbledon, played the match of his life Monday, going for his shots and moving Nadal from corner to corner. Darcis amassed a total of 53 winners, compared with 32 for Nadal.
Darcis finished the match in style, serving an ace down the middle — his 13th — as Nadal failed to chase after the ball.
Earlier, Roger Federer began his bid for a record eighth title at the All England Club with the same dominance that has defined his grass-court greatness.
Ten years after his first Wimbledon championship, Federer opened the tournament on Centre Court as defending champion and looked right as home as he dismantled Victor Hanescu of Romania 6-3, 6-2, 6-0.
This was a grass-court clinic from Federer that lasted 68 minutes. He had 32 winners, seven aces and just six unforced errors.
He won 90 percent of the points when he put his first serve in. When his serve is clicking, Federer usually is unbeatable. On this day, he won his first 15 service points and 24 out of the first 25.
"I'm happy to get out of there early and quickly," Federer said. "So it was a perfect day."
Earlier, Wimbledon produced an upset in the women's draw with fifth-seeded Sara Errani eliminated by Puerto Rican teenager Monica Puig 6-3, 6-2.
Second-seeded Victoria Azarenka overcame a right knee injury from a scary fall beating Maria Joao Koehler of Portugal 6-1, 6-2.