From the beginning things were tight but Halep always seemed to have the edge, squeaking out the first set, 7-5, and staying on serve through much of the second set. But Cepelova broke away for a 5-3 lead in the second set and took it, 6-4, then went up 4-1 in the third against a shell-shocked Halep.
Halep, a semifinalist at Wimbledon a year ago, closed the gap to 4-3 but it was too little too late as the No.106-ranked Cepelova held her nerve to close it out after two hours and 15 minutes, 5-7, 6-4, 6-3.
"I'm so glad that I won today. Simona is such a tough opponent," Cepelova said. "I like big courts, and I just tried to do my best in the moment. I think I was playing well today and I'm just so happy."
Perhaps surprisingly, Cepelova's win over the World No.3 isn't the biggest win of her career - she beat Serena Williams, then the World No.1, in the first round of Charleston on green clay last April.
"Beating Serena definitely gave me the confidence that I could beat Top 10 players," the Slovak said.
"I've had some tough moments this year, but everything is fine now. I'm just really proud."
Halep talked about the shock loss in her post-match press conference.
"To be honest, I have no reaction because, like I said at my first press conference on the weekend, I had no expectations for this tournament. And now here I am," she said. "I knew that it would be a difficult tournament for me, but yeah, I didn't expect to lose in the first round. But she played good tennis today. She was fighting until the end, and she was playing aggressively when she could.
"Life is not always good, but I have enough power to go ahead and just think about what I have to do to do better, and just get the good feeling back on court during my matches. I just have to work hard."
The Romanian was asked to elaborate on why she thought it would be a difficult tournament for her.
"Because I had a few losses before coming here. My confidence wasn't too high. And during matches it's difficult because you feel the pressure, and if you aren't handling it very well, you might lose.
"I knew it would be difficult, but just not like today, to be honest."