More crisp striking from Ostapenko nudged the 20-year-old ahead once more, but the errors flew off her racquet just as regularly and Halep pulled 4-3 in front.
Halep, beaten by Maria Sharapova in the final here in 2014, had been the favourite from the start of the tournament and looked to be cruising at a set and 3-0, with points for 4-0.
Latvia's Jelena Ostapenko celebrates winning her semifinal match against Timea Bacsinszky of Switzerland in three sets, 7-6 (7-4), 3-6, 6-3, of the French Open tennis tournament at the Roland Garros stadium, in Paris, France.
"I felt a little bit nervous", said Ostapenko, the first woman since Jennifer Capriati in 2001 to win the French Open after losing the final's opening set. So I will work hard to climb the ranking and maybe win some more titles... So I want to really hit the ball (smiling).' About her popularity in Latvia, Ostapenko said: 'My match they were translating in the city center on big screen. But also in the deciding moments, I think I played pretty well in those games. Through the seven rounds of the tournament, she hit an incredible 299 winners with youthful abandon.
It was then quite a decisive - and demoralising - turnabout for the world No 3 in the all-important match on Saturday, as she failed to rise to the challenge when it was needed the most.
But again she levelled, and broke in the most spectacular style to win the match with her 54th victor, 6-3. "I need some time to go away", she said.
Playing a fearless brand of tennis with a level of danger that shares similarities with the Auckland Sky Tower jump, Ostapenko took risks throughout the fortnight here and will return to Riga with a grand slam title in the bag.
As she improbably took the title, Ostapenko's aggressive style of play further endeared her to the Roland Garros crowd.
The French Open may have been her first WTA title, but I doubt it will be her last.
"I don't believe I did something too wrong today", Halep said.
Asked when she realised her daughter had so much power, Jelena Jakovleva said: "The day she was born".
The more players who, like Ostapenko, can step up, the better.
"This one hurts a lot more than when I lost in the final three years ago because I realise more what has happened". The match was in the palm of her hand and it appeared to finally be her breakthrough moment after years of consistent results.
Simona Halep (L) was beaten 4-6 6-4 6-3 in the French Open 2017 final. We're going into grass season, where she'll be on even more solid ground.
"When I was in Auckland I really wanted to jump from the tower but my mum really did not want me to do it because she felt it was kind of unsafe".
If Halep wins, she also will move up to No. 1 in the rankings for the first time.
A telling statistic: Of the 33 points Halep won in the first set, only one - yes, just one! - came via a victor off her racket.