The biggest names in the Democratic Party all traveled to Massachusetts to lend Markey a hand. In the past three weeks, President Barack Obama, Vice President Joe Biden, former President Bill Clinton and first lady Michelle Obama all campaigned with Markey.

Gomez and Markey sniped at each other in television ads and in three debates, which featured pointed remarks from both candidates. In the final showdown, a tense moment arose when Gomez challenged Markey on term limits -- a policy that would have prevented the Democrat from remaining in Washington.

Markey countered by asking his Republican rival whether he'd posed the same question to longtime GOP senators like Mitch McConnell and John McCain.

Gomez said he had. Markey, without explicitly accusing Gomez of lying, expressed deep skepticism. The exchange got to the heart of the Republican candidate's central takedown of Markey -- that the longtime Democratic congressman's roots in Washington disqualify him as a voice for Bay State voters.

"Who are the people going to trust to put people in front of party and politics?" Gomez asked at the start of the debate.

Markey seemed to bristle at the suggestion he's been outside of Massachusetts too long, even going as far as reciting his home address in Malden where he said he's lived for more than six decades.

"The question isn't where you're coming from, it's where you're going," Markey said before launching into his own main takedown of his rival. "Mr. Gomez, he's backing these tired old Republican ideas...That's a reflection of who he's going to be with down in the United States Senate."

The winner of Tuesday's election succeeds William "Mo" Cowan. Democratic Gov. Deval Patrick appointed his former chief of staff to serve as interim senator after Kerry stepped down.