The Romanian sixth seed surrendered her serve twice in the opening four games to trail 4-1 but delved into her wealth of experience to finally subdue her 90th-ranked opponent 7-5 in the tiebreak.
More exchanges of breaks followed in the second set before Halep finally found her groove to take a 5-2 lead and set up three match points on Diyas' serve.
The first one went begging but Halep's gritty baseline play paid off in the next point as Diyas bowed out after flicking a forehand long to end a 10-shot rally.
"The first set was very tough and I was very nervous as I seemed to be fighting for every point," Halep said in a courtside interview.
The good news for Halep is that the only previous time she reached the last 32, she made it all the way to the 2014 Roland Garros final.
Halep and her bizarre black and white zebra print dress will be back on court on Friday when she takes on Japan's Naomi Osaka for a place in the fourth round.
(Reporting by Pritha Sarkar; Editing by John O'Brien)