The Spanish second seed, chasing a calendar Grand Slam, recovered from losing the third set for the second straight match to beat Lithuanian journeyman Ricardas Berankis 6-4, 6-4, 4-6, 6-3.
Earlier, Spanish 17th seed Roberto Bautista Agut became the third potential dangerman in Nadal's half of the draw to pull out with coronavirus, following the withdrawals of 2021 runner-up Matteo Berrettini and 2017 finalist Marin Cilic.
Nadal has also benefited from a shock first-round exit for Canada's sixth seed Felix Auger-Aliassime, who took him to five sets at the French Open.
Nadal looked comfortable in the first two sets against Berankis but was broken in his first service game of the third set and could not claw his way back.
But the Spaniard regrouped and raced into a 3-0 lead in the fourth set, sealing the match with an ace after it resumed under the roof following a sharp rain shower.
The 22-time Grand Slam champion, who has not played at Wimbledon since reaching the 2019 semi-finals, admitted he needed to step up his game as he prepares to face Italy's Lorenzo Sonego.
"I didn't play much on grass in three years," he said. "It gives me the chance to keep going, so very happy for that.
"I need to improve. The fourth set was much better.... I have to keep working, be humble, even when things are not going well."
Stefanos Tsitsipas and Australian maverick Nick Kyrgios remain two of Nadal's biggest challenges and they will meet in a mouthwatering contest on Saturday.
Kyrgios was on his best behaviour on court as he steamrollered Serbian 26th seed Filip Krajinovic 6-2, 6-3, 6-1 in just 85 minutes.
The 27-year-old, who made the quarter-finals on debut at the All England Club in 2014, did not face a single break point.
"I just wanted to remind everyone that I am pretty good," he said. "I was nowhere near my best in the first round but today I was in my zone."
Kyrgios's five-set opening win over Paul Jubb of Britain was marred by his admission that he spat in the direction of fans, accusing them of being disrespectful.
"There was just nothing the media possibly could tell me I did wrong today," he said. "I just know that you can't possibly ask me anything and stir anything up."
Late Thursday, Kyrgios was fined $10,000 for Tuesday's incidents.
Fourth seed Tsitsipas had few problems in defeating Australia's Jordan Thompson 6-2, 6-3, 7-5.
"I feel like everyone here knows who Nick is," said the Greek player.
"We have had many great matches against each other. I respect him for his game and the way he fights when he wants to."
Poland's Swiatek needed just over two hours to see off Dutch lucky loser Lesley Pattinama Kerkhove 6-4, 4-6, 6-3.
Swiatek was in early trouble before winning four games in a row to take the first set but went down a break in the second and could not recover.
In the end, though, Swiatek took charge in the decider, breaking for a 3-1 lead and closing out the match.
She surpasses Monica Seles’ 36-match winning streak from 1990 and matches Martina Hingis's 37-match winning run from the beginning of the 1997 season.
"I would say the grass is pretty tricky for me, I'm not going to lie," said Swiatek, who faces France's Alize Cornet next.
"I guess you can see that I'm not playing maybe as efficiently as on other surfaces.
"Basically my confidence is getting better overall. But this tournament is tricky and I'm still feeling out how to play the best game here."
British wildcard Katie Boulter shocked 2021 finalist Karolina Pliskova 3-6, 7-6 (7/4), 6-4 before dedicating her win to her late grandmother, who died this week.
Fourth seed Paula Badosa set up a clash against two-time champion Petra Kvitova after both had straightforward wins.
Coco Gauff eased past Romania's Mihaela Buzarnescu 6-2, 6-3 -- hammering the fastest serve of the women's tournament, a screamer clocked at 122 miles (192 kilometres) per hour -- and will next meet fellow American Amanda Anisimova.