Edward J. Markey, a Massachusetts liberal Democrat who served in the House for more than three decades, was sworn in as the newest member of the Senate Tuesday morning.

Sen. Ed Markey (Michael Dwyer/AP photo, File)

Markey defeated Republican Gabriel Gomez in a June special election to fill the seat once held by Secretary of State John Kerry. Markey's win came about three and a half years after Republican Scott Brown shocked the political world with a Senate special election victory.

Resolving not to be caught off guard again in deep blue Massachusetts, national and state Democrats rallied around Markey early, and President Obama and Vice President Biden joined him on the campaign trail late in the race.

The beginning of Markey's Senate career marked the end of Democrat Mo Cowan's brief tenure in the upper chamber. Gov. Deval Patrick (D) appointed his close confidant Cowan to serve as an interim replacement for Kerry, who was sworn in as the nation's chief diplomat in February.

"Been an honor to serve MA as Senator," Cowan tweeted Monday. Cowan spent just over four months as a senator.

Markey was flanked by Cowan and and Sen. Elizabeth Warren (D-Mass.) as he entered the Senate chamber to take the oath of office.

Faced with a crucial day of work on executive branch nominations, Majority Leader Harry Reid (D-Nev.) ensured Markey's swearing-in ceremony would move swiftly.

"I know a lot of people want to say some real nice things about this good man. But we are going to have to do it later," Reid said.

Markey served in the House since 1976, representing a suburban district to the north and west of Boston.