Mitt Romney has been there before: entering a third, crucial debate in a topsy-turvy contest.

Ten years ago, he battled Democrat Shannon O’Brien in his bid to land the open governor’s job in Massachusetts. On Monday, he’ll face off against President Obama in the final showdown before the November vote.

The circumstances are strangely similar: Going into that last debate in Massachusetts, Romney had eroded O’Brien’s lead but had to make up for a few bad moments in the second. The final confrontation, on Oct. 29, 2002, was his last opportunity to dominate the race. And he seized it, using what have by now become familiar tactics that he has deployed during this year’s presidential run.

In Massachusetts, the candidates were seated at a round table with the moderator, NBC’s Tim Russert, across from them. “It was very close quarters,” recalled O’Brien, then the 43-year-old state treasurer. Romney “looked me in the eye.” Right after she reprised a famous Ted Kennedy zinger calling Romney’s abortion position “multiple choice,” the GOP candidate glowered, talked about his mother’s belief in access to abortion and scolded O’Brien for interrupting him.

“I do not take the position of a pro-life candidate,” he said to his rival. “I am for a woman’s right to choose. And your effort to create fear and deception here is unbecoming.”

Explore the 2012 electoral map and view historical results and demographics

This was followed by a testy exchange in which O’Brien scoffed: “You don’t have a record. It’s one of waffling.” Romney held up his hand: “Shannon, I think this debate should be raised just one notch. Stop trying to scare people.”

Romney’s “unbecoming” comment and his apparent lecturing of O’Brien reverberated inside Suffolk University Law School, where the debate was held, and resounded in the local papers. Although the Republican insisted that his use of the word was gender-neutral, O’Brien supporters such as then-Sen. Hillary Rodham Clinton (D-N.Y.) and Teresa Heinz, wife of Sen. John F. Kerry (D-Mass.), called him out on the comment.

The debate proved pivotal, and the damage was done — to O’Brien. Earlier in the debate, O’Brien had fumbled a question about abortion. Russert noted that the state required minors to obtain parental consent before getting a tattoo, but not before undergoing an abortion. The moderator added that he had called a local tattoo parlor to confirm. The question sounded sort of cheeky, so O’Brien ran with it. “Would you like to see my tattoo?” O’Brien asked Russert, who responded, “This is a very serious issue.”

“I made a stupid joke,” O’Brien recalled in an interview. Russert “got mad and kind of hit me between the eyes.”

In the holding rooms where the candidates’ staffs were watching, each side knew it was witnessing a transformation of the debate and the overall race. “At that moment, I knew we had won,” said Ben Coes, a top Romney aide in 2002. “She just had one of those unfortunate moments where she mishandled a very serious question.”

The debate was momentous for Romney’s team, Coes said. “A month out, we were 10 points behind,” Coes said. Romney convened some of his top aides — strategist Mike Murphy as well as loyalists who remain trusted advisers today, including longtime confidant Robert F. White, Eric Fehrnstrom and Beth Myers. They met in his basement in Belmont, Mass., to map out an ad strategy to close the gap. And they planned debate-prep sessions, including a few in soundstages to replicate the television studio, Coes recalled. Myers stood in for O’Brien.

“She even looks like Shannon,” Coes said.

O’Brien has admitted that she felt confused by too many directives: Smile! Parry! Use humor! Be yourself! And she was tired from the relentless pace of the campaign. And now, years later, she acknowledges that she flubbed her chance to become the first elected female governor of her state.

“I came across as being mean,” said O’Brien, now living in Whitman, Mass., and consulting for tech companies. “Frankly, I don’t know if I came across as very likable that night.”

She has revisited the debate online and noticed her strain as she listened to what she thought were Romney policy shifts. “I was trying not to use words that rhyme with friar,” she said. “I see that I’m just disgusted.”

Romney capi­tal­ized on a particular difficulty O’Brien had as a female candidate. “In general for women, they need to project confidence,” said Adrian Durbin, O’Brien’s media consultant in the race. “Men can be more assertive, whereas women come off as abrasive.” When Romney called O’Brien “unbecoming,” he transmitted, in Durbin’s opinion, a tone of “how dare this woman be here questioning me like this!”

O’Brien’s campaign manager, Dwight Robson, saw Romney use a tactic that he has used since to great effect.

“Whether it was his unbecoming comment or some other remarks, he pretty skillfully turns the table, almost in a how-dare-you attitude,” said Robson, who runs a nonprofit group that helps people with developmental disabilities. “He has a sincere demeanor about him that I think is effective in these debates.”