The Romanian's 6-4 6-7(5) 6-3 triumph ensured she advanced to the semi-finals at Indian Wells for the third time.
Halep will next face 20-year-old Naomi Osaka, who stunned fifth seed Karolina Pliskova 6-2 6-3. Osaka, ranked No. 44, will be playing in her first semi-final this year.
'Time to end our working relationship' - Halep and coach Cahill part ways
Halep was exhausted by the conditions. "It was too much,” said Halep of the 25mph gusts. "It was tough to play because the ball was really moving and we didn’t really know what’s going on court. Here because of the altitude as well.
"In the last few years, I don’t remember such difficult wind and to feel that tough to play a game.”
After Halep claimed the first set, Martic built a 5-2 lead in the second, and while the world number one fought back to level at 5-5, the Croat emerged with the set in a tiebreaker.
Halep, however, raced away with the match in the third set. "It was good that after 3-1 I just woke up, and I realised that I’m not doing the right thing on court,” Halep said. "And it was really good that I can see that and change that, so that makes a big (difference).”
Opinion: No multiple major winners again, but Barty’s 2021 season should be given more respect
'She's not afraid' - How Raducanu 'transcends crowd and gets them on her side'