(NYTIMES) — BOSTON — Representative Edward J. Markey, a Democrat who has toiled for almost 40 years in the House in both the majority and minority, won a promotion to the Senate on Tuesday in a sweeping victory over Gabriel Gomez, a Republican who has never served in elective office.

Mr. Markey, 66, replaces John Kerry, who stepped down earlier this year to become secretary of state, and he will provide a reliable vote for President Obama’s agenda, which seemed to be just what voters wanted.

“The Senate needs to be controlled by Democrats,” said Pam Wechsler, 52, a prosecutor, as she voted Tuesday morning in Boston’s West End.

Note: Read our discussion guidelines before commenting.