In men's doubles, the unseeded Raja and Sharan upstaged the 15th-seeded Austrian-Croat combo of Oliver Marach and Mate Pavic 6-4, 3-6, 6-4 in a second-round match that lasted 131 minutes.
To his credit, Sousa refused to give in and a frustrated Djokovic threw his racquet to the ground after a break-point opportunity had passed him by in game five of the third set. "I believe I played the best match since a while".
Venus Williams shook off a slow start to ease into the third round with a 6-3, 6-1 victory over Japan's Kurumi Nara.
In conditions he later described as "very muddy, very slow, no bounce", Djokovic found it hard to hit through Schwartzman's consistent groundstrokes. "I knew it was going to be a battle out there".
Djokovic came out firing in the fourth, a brutal forehand giving him a 2-0 advantage and he broke again to lead 4-0, prior to being given a code violation after making his feelings be known to the umpire when he lost a first serve for a second time violation.
Sixth seed Dominic Thiem stormed into round three with a routine win over Simone Bolelli, sweeping the Italian aside 7-5, 6-1, 6-3. It took 12 games for the World No 63 to register a mark on the scoreboard.More news: MLS All-Star opponent Real Madrid win second straight UEFA Champions League
Meanwhile, Defending French Open champion Garbine Muguruza survived a scare to beat world number 99 Anett Kontaveit 6-7 (4-7) 6-4 6-2 and reach the third round.
"In the beginning of the match he was not playing bad, and I was able to produce winners, play with no mistakes and play very long. I played very well".
"Perfection? I don't know about that", said Nadal, who plans to celebrate his 31st birthday on Saturday by watching Real Madrid take on Juventus in the Champions League final. I wanted the match.
Fifth-seeded Milos Raonic of Canada also advanced to the fourth round when his opponent, Spain's Guillermo Garcia-Lopez, retired from the match with a left thigh injury.
The 23-year-old admitted that she would be following her regular routine at Wimbledon, where she hopes to atone for last year's shock second-round exit.
Nadal finished his match with a tally of 33 winners and only 13 unforced errors.