The Romanian top seed eventually downed the American 6-3, 6-7 (5/7), 6-4 after two-and-a-half hours in another unconvincing display after also struggling in her opening match.
The pressure on the reigning French Open champion will only increase in her next round, when she faces seven-time Grand Slam champion Williams.
“I have no idea how I won this tonight, it’s so tough to explain what happened on court,” Halep said after overcoming the dogged Kenin, ranked 37 in the world and fresh from winning the warm-up Hobart International.
Halep, 27, won the first set comfortably and appeared to be cruising at 3-0 up in the third when her momentum faltered and she found herself in a battle for survival.
“It was difficult to stay in there for every ball and run so much,” she said.
“I got a little bit injured in the second set but I just fought because I wanted to win.”
Halep did not provide details of her injury but a herniated disc cut short her season last year.
She lost an epic final to Caroline Wozniacki in Melbourne in 2018 but arrived this year on a five-match losing streak, equalling the worst run of her career.
The Romanian paid tribute to Kenin, a Russian-born American aged just 20, whose lost in the first round on her only previous campaign at Melbourne Park last year.
“It was a very tough one, she’s an amazing player,” she said.
Halep made a promising start with a break in the first game and kept the rallies short on her own serve to hold easily.
Kenin’s error rate mounted as the first set wore on and Halep broke again to claim it after 33 minutes.
Halep looked to be cruising early in the second set, with Kenin scoring only two points as the Romanian raced to a 3-0 lead.
But the American fought back with a break in the fifth and took the set to a tie-break, forcing a decider when a scrambling Halep hit her return long after a 12-shot rally.
The third set’s opening game turned into an epic arm-wrestle that went to deuce seven times as Halep failed to convert four break points against the dogged Kenin.
Disaster loomed when the Romanian went down a break in the sixth game but she rallied to get back on level terms in the next, and then made a decisive second break.