Incumbent Massachusetts U.S. Sen. Ed Markey and his lone primary challenger for the Senate seat, U.S. Rep. Joe Kennedy III, debated for the first time on Tuesday evening ahead of the September primary election.

The hour-long debate was held in WGBH's Brighton studio, and Boston Public Radio hosts Margery Eagan and Jim Braude moderated.

Kennedy, 39, surprised many when he announced his bid to runagainst Markey, 73, in September. Markey has held the Senate seat since 2013, and served as a U.S. congressman for 37 years before that. Kennedy is in his eighth year as a Massachusetts U.S. congressman.

Brookline attorney Shannon Liss-Riordan launched a campaign for the seat last May, but dropped out of the race in mid-January. She has not endorsed either candidate, but told the State House News Service that "whoever wins this race will be a strong advocate for Democratic values."

Kennedy, whose famous surname has deep roots in Massachusetts politics, is the grandson of former U.S. Attorney General Robert F. Kennedy and the son of former U.S. Rep. Joseph Patrick Kennedy.

Presidential candidate and senior U.S. Sen. Elizabeth Warren has endorsed Markey for the seat; both Senate candidates have thrown their support behind Warren for the presidency.

Correction: This article has been updated to include the correct month of the Senate primary election. It is in September.