Republican Senate nominee Gabriel E. Gomez campaigned today with Senator John McCain, going on offense against Democrat Edward J. Markey for his votes on issues of homeland security.

At a VFW hall in Dorchester with the 2008 GOP presidential nominee standing by his side, Gomez attacked Markey for voting against a 2004 resolution expressing sympathy to the victims of the 9/11 terrorist attacks and a similar 2006 measure.

“One thing that I just can’t understand is how my opponent, Congressman Markey, has voted more than once against a very basic Congressional resolution, to simply honor the victims of 9/11,” Gomez said.

Advertisement - Continue Reading Below

Markey was one of 16 congressmen to vote against the 2004 resolution and one of 22 to vote against the 2006 resolution.

“To me it’s just unconscionable to have voted against something like that,” Gomez said.

The attack represented something of a pivot for the Gomez campaign, attempting to put their Democratic opponent on the defensive.

A spokesman for Markey, Andrew Zucker, called the attacks “despicable” in a statement.

“Ed Markey has always supported the victims of 9/11 – that’s why he joined Democrats and Republicans like Ron Paul in voting against resolutions that blatantly politicized 9/11 and denigrated the memory of those who died. Gabriel Gomez should be ashamed of himself,” Zucker said.

Gomez also attacked Markey for voting in favor of the Patriot Act in 2001, but against the legislation’s subsequent reauthorizations.

“As for the Patriot Act, here’s where his politician DNA got into him a little bit. First he was for it, then he was against it,” Gomez said.

Another Markey spokesman, Mark Horan, told the Globe Sunday night Markey had voted in favor of the legislation as “temporary authority during a time of national crisis” but did not support “giving permanent, overly broad powers to investigate private records without consistent oversight and public debate.”

Gomez said he was only two years old when McCain’s Navy plane was shot down over Vietnam in 1967 and his parents had recently immigrated to the United States from Colombia.

“Never in their wildest dreams did they imagine their son” would go to the Naval Academy, Gomez said. That journey could only happen in America, he said.

Gomez and McCain, both former Navy officers, stood in front of five American flags and were surrounded by other veterans on the small VFW stage.

McCain took the microphone to cheers.

“I’m here because I believe in this young man,” McCain said, calling Gomez a “good and decent American.”

McCain said Gomez would be a bipartisan senator and noted their shared support of certain gun control legislation and comprehensive immigration reform.

The Arizona Senator exhorted the crowd to work to get out the vote over the next month in advance of the June 25 election.

“This is a tough fight and he’s the underdog right now,” McCain said.