Mr Markey had harnessed support from progressive leaders to overcome the challenge from a younger rival who is a member of America’s most famous political family.
It marks the first time a Kennedy has lost a race for US congress in the state. Mr Kennedy is the son of former representative Joe Kennedy II, the grandson of Robert Kennedy, and the grand-nephew of John F Kennedy.
Mr Markey appealed to voters in the deeply Democratic state by aligning himself with the liberal wing of the party.
He teamed up with a leading progressive, New York representative Alexandria Ocasio-Cortez, on the Green New Deal climate change initiative – and at one point labelled Mr Kennedy “a progressive in name only”.
That helped Mr Markey overcome the enduring power of the Kennedy name in Massachusetts.
The 39-year-old congressman had sought to cast the 74-year-old Mr Markey as someone out of touch after spending decades in congress, first in the house of representatives before moving to the senate.
At a victory celebration in his hometown of Malden, Massachusetts, Mr Markey ticked off a series of priorities, from support for the Black Lives Matter movement to a call for Medicare for All, to combating climate change, a signature issue for Mr Markey.
Grateful. https://t.co/SwW9VmTcQj
— Groundwork Project (@GroundworkProj) September 2, 2020
Advertisement
“Every other problem is linked to it,” he said.
“No solution to any challenge will be successful unless we address it. There will be no peace, no justice and no prosperity unless we stop the march to climate destruction.
“We must pass a Green New Deal.”
Of President Donald Trump, Mr Markey said: “He is the most corrupt, most racist, most incompetent president in American history.
“We must banish his agenda of division and destruction to the history books.”
Earlier on Tuesday, Democratic representative Mr Kennedy said that while the results are not the ones he had hoped for, he would work for Mr Markey’s re-election in the November poll.
He said: “The senator is a good man. You never heard me say otherwise.”
Mr Kennedy also suggested that the movement of supporters the campaign pulled together would continue past the current election.
“We may have lost the final vote count tonight but we built a coalition that will endure,” he said. “I would do this again with all of you in a heartbeat.”
In the waning weeks of the campaign, Mr Kennedy had leaned into his family’s long political legacy in Massachusetts. His pedigree includes former president John F Kennedy; former US senator and US attorney general Robert F Kennedy, his grandfather; and former US senator Edward Kennedy, who held a senate seat in Massachusetts for nearly half a century until his death in 2009.
Mr Markey countered by leaning into his own family story – growing up in the working class city of Malden with a father who drove a truck for the Hood Milk company.
The incumbent now faces a general election contest where he is considered a strong favourite against Republican primary winner, Kevin O’Connor, in November.