With less than three weeks until election day, Democratic congressman Ed Markey and Republican rival Gabriel Gomez held their first debate Wednesday in the race for Massachusetts' open seat in the U.S. Senate.

Markey rebuffed a volley of criticism from former Navy SEAL Gomez who sought to paint the veteran lawmaker as out of touch with voters while tapping into public frustration with a federal government bogged down by controversies.

"You are basically Washington, D.C.," Gomez told Markey, who has spent 37 years in Congress. "I'm sorry sir, but you are."

Issues dogging the administration of Democratic President Barack Obama include reports that the Internal Revenue Service targeted conservative groups for extra scrutiny, the seizure of reporters' records by the Department of Justice, and the deadly attacks on the U.S. consulate in Benghazi, Libya, last year.

Markey accused Gomez of politicizing the Benghazi attack - in which militants killed U.S. Ambassador Christopher Stevens - as part of a broader Republican effort to hurt former Secretary of State Hilary Clinton's chances for the Democratic presidential nomination in 2016.

Obama and Clinton were criticized for failing to ensure the security of diplomatic staff overseas and for delays in the subsequent investigation.

The Senate seat became available when President Obama named then-Senator John Kerry as Clinton's replacement as secretary of state.

Markey was seen as having the most to lose in the debate, the first of three ahead of a June 25 special election. A New England College poll on Wednesday showed 52 percent of registered voters backing Markey, compared with 40 percent for Gomez.

The split largely reflected the state's overwhelmingly Democratic electorate, said Ben Tafoya, who ran the poll.

"The clock is running out for Gomez, but it's not inconceivable that something could happen in the debates to change things," Tafoya said.

Jeffrey Berry, a professor of American politics at Tufts University, said he believed Markey may have come out of the debate stronger than when he went in.

"Markey's strategy was to reinforce his appeal to liberal democrats because he believes they are the most likely to come out on election day, which is a sound strategy," he said.

"For Gomez, this was a lost opportunity," adding he did not seize on the Republican's perceived advantage on the issue of the flagging U.S. economy.

Democrat William "Mo" Cowan is serving as interim senator until the Massachusetts special election.

Markey and Gomez have made the national Republican Party an issue in the Massachusetts race, with Markey's campaign trying to tie Gomez to a party that tacks more conservative than many Massachusetts voters, while Gomez has stressed his independence.

In the New England College poll, roughly three-quarters of registered voters in each party backed their party's candidate, with Gomez enjoying a slight lead among independents. The poll surveyed 734 voters on June 1 and 2.

The Massachusetts seat is one of two at play in the U.S. Senate, where Democrats now have a majority of 54 seats, including two independents who caucus with the Democrats. Republicans hold 45 seats.