The 14-time Grand Slam champion prevailed 6-2, 3-6, 6-7 (2/7), 6-3, 7-5 in 4hr 12min and will now play unseeded Israeli Dudi Sela in the third round. Nadal looked to be suffering from stomach cramps during the match and called for the trainer and doctor early in the third set.
He took a tablet and continued on but at one changeover motioned to his player box that he was experiencing a stomach ailment. He was physically ill on the court.
"For me after a tough period of time out of competition in the last seven months and just playing a few matches, today was a little bit humid and I felt very tired after the first set and for the whole match," he said.
"I tried to have my best attitude and always with the support of the fantastic crowd." The Spanish great appeared to be making some headway when he broke Smyczek's serve to lead 5-3 only to give back the service break with a double-fault on break point.
The marathon 81-minute third set went to a tiebreaker which the American qualifier captured seven points to two. Nadal regrouped and sent the match into a fifth set and he tried to fight off his health problems and the tigerish Smyczek.
The breakthrough came in the 11th game of the final set when Nadal broke Smyczek's serve and then wrapped up the victory on his fourth match point to his immense relief.
"It was a very tough night for me. I first want to congratulate Tim because he's a gentleman for what he did in the last game," Nadal said.
"Not many people would have done what he did at 6-5 in the fifth set after four hours."
A spectator yelled out as Nadal served at a crucial moment, but Smyczek allowed the serve to be retaken. Nadal said he suffered from stomach cramps after the first set.
His shaky condition showed when he committed an uncharacteristic 53 unforced errors and double-faulted three times on break points. He lost his serve five times.