"She's a grinder," Sharapova said of Dementieva. "She makes you hit a lot of balls. You really have to be steady with her, and take your opportunities when you get them."
Sharapova, who missed nearly a year with a serious shoulder injury, will be making her first appearance in a final since April 2008.
Kleybanova, who needed 3 hours, 16 minutes to beat No. 5 Jelena Jankovic in the quarterfinals the previous night, was up 3-1 in the third set. However, Sharapova clawed back, breaking Kleybanova twice to roar ahead 5-4.
She then closed out the 2-hour 37-minute marathon with back-to-back aces, her third and fourth of the match.
Sharapova has dominated Dementieva in her career, winning eight of their 10 matches. They last met at the 2008 Australian Open, where Sharapova won 6-2, 6-0 in the round of 16.
The 27-year-old Dementieva, who lost to Williams in a nearly 3-hour semifinal match at Wimbledon, kept her cool while overcoming a 5-3 deficit in the first set.
"I was really waiting for this match after Wimbledon," said Dementieva, who has two tournament wins this year but none since January. "It's always very interesting to play against Serena, and I was looking for revenge after Wimbledon.
"I was very positive on the court, and very satisfied with the way I was playing."
The second-seeded Williams came into the match as the hottest player in the tournament, but an unreliable serve and a litany of unforced errors were her undoing. The 2001 Rogers Cup champion was broken five times and looked out of rhythm from the start, hitting routine shots long, wide or into the net.
"I can't say I was especially feeling the fire," Williams said. "Obviously you want to do well, and I always really want to do well. Honestly, I think I could have and should have won, but I didn't, so ... it is what it is."
Dementieva has now beaten Williams in four of their last five hardcourt meetings, a positive sign for the Russian with the U.S. Open getting under way in just over a week. However, Dementieva wasn't looking that far ahead.
"You never know," said Dementieva. "I feel like I've had a lot of good matches over the past three weeks, and I hope it's going to be a good preparation for the U.S. Open. But right now, I just want to focus on the final."
Williams entered Saturday having been broken just once in her first three matches -- and it was the only break point opportunity she had allowed all tournament. But she struggled from the outset against Dementieva, giving up a break in the third game of the match.
Williams, though, was actually satisfied with the level of her service game against Dementieva.
"I don't think I had too many service problems," said Williams. "I think I served better than I did my first two rounds."
The players traded several more breaks -- six in total -- before Dementieva prevailed in the tiebreaker. She opened up a 4-1 lead and eventually captured the set when Williams hit a forehand long. It was the first set Williams had lost all tournament.
"I really probably should have won the first set, which probably would have (led to) a different result," she said. "But I didn't. I started making a lot of errors [on] key shots I should have made."
Dementieva broke Williams early in the second set to jump ahead 2-0 and held serve the rest of the way. The match ended when Williams pushed a forehand wide.
Kleybanova fought off 12 break points in her first two service games before Sharapova capitalized on No. 13 to take a 2-1 lead.
Sharapova converted her next break point chance to extend her advantage to 4-1 and held serve from there, making good on her third set point.
Kleybanova opened the second set with a flourish, breaking Sharapova for the first time in the match and building a 3-0 lead. Sharapova stormed back to level the set 4-4, but Kleybanova pulled back in front and earned a break to win the set after Sharapova committed her ninth double-fault.
In the early doubles semifinal, the sixth-seeded Spanish tandem of Nuria Llagostera Vives and Maria Jose Martinez Sanchez beat No. 4 Daniela Hantuchova of Slovakia and Ai Sugiyama of Japan 6-4, 6-4. They'll face the winner of Saturday's late doubles match, which pitted the top-seeded duo of Zimbabwe's Cara Black and Liezel Huber of the U.S., against third-seeded Rennae Stubbs and Samantha Stosur of Australia.