The comments, which echoed similarly heated rhetoric on Friday, suggest a shift for Gomez to a more aggressive posture. Until now, his campaign has largely focused on his biography, with Gomez emphasizing his experience as a Navy SEAL and his status as a Washington outsider but eschewing such direct engagement on Markey’s votes.

“The bottom line is: Nothing he’s done has made our nation safer,” Gomez said of Markey at a high-dollar fund-raiser, one of the two events he attended with Senator John McCain.

Republican Gabriel E. Gomez, on defense in the early weeks of his race against Democrat Edward J. Markey, on Monday unleashed a frontal attack on his opponent’s homeland security credentials, trying to put Markey on his heels just over a month before voters go to the polls and elect a new US senator.


Gomez, however, was clearly on offense Monday, calling Markey’s votes “out of the mainstream.”

Gomez and McCain appeared at the Boston VFW Post in Boston. Michael Dwyer/AP

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 that expressed sympathy to the victims of the 9/11 terrorist attacks and lauded first responders and international allies. He also assailed his opponent for voting against a similar 2006 measure.

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.

Markey and his campaign aides defended his opposition to the resolutions and said both were perniciously political.

Markey said he objected to the 2006 resolution because it included a reference to the Patriot Act, which he initially voted for but was hoping to phase out at the time. He said he opposed the 2004 resolution because it mentioned Saddam Hussein, implicitly linking the Sept. 11 attacks to the war in Iraq.


“I wasn’t going to vote and say to the people who were the victims here from Boston that Saddam Hussein had something to do with what happened on 9/11,” Markey said. “I knew it was not true. The families knew it was not true. I had to vote no.”

Markey, who voted for the war in Iraq but later came to regret the vote, argued that the Bush-Cheney administration was trying to use the resolution to bolster the connection between the war and the Sept. 11 attacks. He said he voted for eight other resolutions honoring Sept. 11 victims.

“I want to honor the 9/11 victims,” he said. “But you cannot dishonor what happened by allowing Dick Cheney to actually perpetrate a fraud by having a resolution that then links what happened on 9/11 to Saddam Hussein.”

At the speech in Dorchester, Gomez sported his signature green Navy flight jacket and spoke in the subdued tone that often marks his oratory on the trail, yet his comments were noticeably more feisty throughout the appearance than in previous weeks.He attacked Markey for voting in favor of the Patriot Act in 2001 but against the legislation’s subsequent reauthorizations.

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

Markey spokesman Mark Horan said in a statement that the congressman 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 went on to slam Markey’s no vote on the 2002 bill that created the Department of Homeland Security, which most congressional Democrats opposed. Markey said he objected to the bill because it would have stripped some collective bargaining rights from federal workers.

Gomez’s more hard-charging tone was on display Friday when he contrasted his life experience with Markey’s votes on security issues at a campaign stop in South Boston.

“He has no idea just how dangerous is the world that we live in,’’ Gomez said. “I can tell you I know how dangerous is the world we live in. And I will take it very seriously when I go down to D.C.”

The attacks came into sharper relief Monday as Gomez appeared with McCain, a senator know for his hawkish positions on homeland security issues. The McCain visit also signaled a sign of support from an influential national Republican.

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 in Dorchester. In the Republican primary, Gomez faced criticism for donating to Barack Obama in 2008 but has said he ultimately voted for McCain. The GOP candidate lost to Obama in the Bay State 62 percent to 36 percent.

McCain took the microphone at the hall to cheers Monday.


“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 the recent failed gun control legislation, as well as comprehensive immigration reform. He exhorted the crowd to work to get out the vote over the next month in advance of the June 25 election.

At the fund-raiser later at the Fairmont Copley Plaza, McCain joked with the crowd before turning serious as he spoke of the upcoming election.

“We know what happened in 2012,” he said, referring to the year when Republican Scott Brown was defeated by now Senator Elizabeth Warren.

“We also know what happened in 2010,” McCain told the crowd, referencing Brown’s upset special election victory.

“I believe we can repeat that remarkable event,” he said.

Michael Levenson and Stephanie Ebbert of the Globe Staff contributed to this report. Joshua Miller can be reached at joshua.miller@globe.com. Follow him on Twitter @jm_bos.