Halep fended off four set points to claim a back-and-forth first set in a tiebreak after storming to a 4-1 lead before U.S. Open champion Stephens fought back to level.
In a repeat of this year's French Open final, also won by Halep, the world No 1 ran out a 7-6 (8-6) 3-6 6-4 victor in a pulsating match of high quality and high drama.
Stephens added three more breaks to take the second set, but lost her serve to open the third.
Australian No.1 Ashleigh Barty is just one match away from a maiden Canadian Open finals appearance after defeating Belgian Kiki Bertens in straight sets. "I just went all the way also on her forehand, short, cross, long, everything".
Romanian Halep, who had beaten Stephens in Paris in June, claimed her second Montreal title in three years and third for the 2018 season.
With the win Stephens advances to her second consecutive Rogers Cup semifinal after falling to Caroline Wozniacki past year.
"It was really tricky conditions.and we were both struggling a little", Barty said in her on-court interview. "She makes me play better and better every time we meet each other".
"I think I played smart tennis today", Halep said.
Another poor service game from Halep though gave the initiative back to Stephens, who broke for 5-5 and then held for a 6-5 lead. Halep has won her past six meetings with the 25-year-old American.
Halep had taken the first set on a tie-break, after saving four set points against American third seed Stephens. It was the first set Stephens lost all week.
"I thought I played well, I thought she played well", said Stephens.
Both players broke serve in the first three games of the second set, which gave Stephens a 2-1 lead.
She broke back for 2-2, but then suffered a letdown as Halep broke service twice more to take the lead.
But Halep couldn't hold her serve in the ninth game of the second set.
Stephens refused to go quietly though, saving a match point before breaking for 5-3, and then saving two more match points to hold.
However, Halep called on all her reserves of energy to break the resilience of the third seed, shrugging off a double fault at championship point along the way, as she completed a memorable victory. "I hope in the future it's going to be better".