The 22-time Grand Slam champion beat the Italian player on Centre Court.
"It's been my best match at the championship so far, against the most difficult player I've faced at this level," Nadal told the crowd after the match. "I wish him all the best for the rest of the season. He has a great future here."
A few points after Nadal visited the umpire following an incredible shot by Sonego, Nadal called him to the net after he was broken on serve to make it 4-4 in the third set, though it was unclear why.
The two exchanged words. And then exchanged further words after Nadal served out the match. The two then took the discussion to the locker room.
"First of all, I have to say I was wrong. I should not call him on the net," Nadal said after the match. "So I apologize for that. My mistake. After that, there are other things during the match I do not want to comment as we have talked in the locker room.
"... There was one thing that was bothering me that he was doing in that moment. There are so-called codes between players. We had some issues there, but that's it."
Nadal, who has won the Australian Open and French Open this year, won the title at the All England Club in 2008 and 2010.
The 36-year-old star next plays 21st-seeded Botic van de Zandschulp of the Netherlands for a spot in the quarterfinals.
Fritz, seeded 11th, beat the Slovakian 6-4, 6-1, 7-6 (3) on No. 3 Court, hitting 20 aces and only one double-fault. He will next face qualifier Jason Kubler of Australia for a spot in the quarterfinals.
Kubler beat American qualifier Jack Sock 6-2, 4-6, 5-7, 7-6 (4), 6-3 in their third-round match.
A total of four American men are into the round of 16 at the All England Club for the first time since 1999 after victories Saturday by Fritz and unseeded Brandon Nakashima. They join No. 23 Frances Tiafoe and No. 30 Tommy Paul, who advanced a day earlier.
American Jenson Brooksby, the No. 29 seed, will not be joining his compatriots in the next round, however, as he fell to Chile's Cristian Garin, who reached the fourth round for the second straight year with a 6-2, 6-3, 1-6, 6-4 victory.
The 26-year-old Garin, who is ranked 43rd, said he appreciated the chants from compatriots in the stands at No. 3 Court.
"When I hear that, I know that the Chileans are [here] somewhere, so that's good," Garin said.
Brooksby, 24, was making his Wimbledon debut.
ESPN's Tom Hamilton and The Associated Press contributed to this report.