It was the second time in the tournament that Nadal had dropped a set after his victory against Francisco Cerundolo earlier in the week as he begins his pursuit of a 23rd grand slam title.
“Every day is a challenge, that’s the truth. All the opponents are difficult,” Nadal said in his on-court interview.
“We are playing against the best players of the world … Every day is an opportunity to improve, and today, I’m through, so that gives me the chance to keep going — very happy for that.”
After Nadal took the first two sets, Berankis, ranked No. 106 in the world, hit back in the third thanks to an early break of serve.
A 50-minute delay for rain ensued in the fourth to allow time for the roof to close, but Nadal was already 3-0 up in the set and soon wrapped the match in just over three hours once play resumed.
The 36-year-old faces Italian 27th seed Lorenzo Sonego in the third round on Saturday.