The 20-year-old trailed by a set and was 3-0 down in the second to Halep – who would have become world number one with a win – but prevailed 4-6 6-4 6-3, according to the BBC.
Ostapenko, ranked 47th, had never won a Tour-level title before and was playing in only her eighth Grand Slam.
She is the first unseeded woman to win at Roland Garros since 1933.
“I cannot believe I am champion at 20 years old. I love you guys. It’s so amazing to be here,” said Ostapenko.
“I have no words, it is my dream. I’m so happy. I knew Simona was a great player, but I tried to play aggressively and everything turned my way. I fought for every point. I’m glad it finished my way.”
Halep was playing in her second French Open final, after losing in three sets to Maria Sharapova in 2014.
“I’m sad I couldn’t win it, but it was a great experience,” said 25-year-old Halep.
“Now I want to congratulate Jelena – it’s an amazing thing. Keep it going because you are only a kid.
“I would like to thank my team, my parents. It’s a tough day, but let’s keep working and let’s believe.
“I felt sick in the stomach to play in this final, so maybe I wasn’t ready to win it, but maybe next time.”