GABRIEL GOMEZ, the Republican candidate to fill Massachusetts’s vacant Senate seat in a special election on June 25th, ponders his resemblance to Scott Brown, the Republican victor in the previous such election three years ago. Mr Brown is an army reservist, Mr Gomez points out, whereas he is a navy man. “It’s totally different,” he jokes.

The two races have much in common. In both cases, a veteran Democrat suddenly left his seat up for grabs: Teddy Kennedy (first elected in 1962) died in 2009; John Kerry (first elected in 1984) has just become secretary of state. Both times, the Democrats nominated a big-cheese candidate: in 2010 they opted for Martha Coakley, the state’s attorney-general, and this time Ed Markey, a congressman for 37 years. The Republicans, by contrast, plumped for fresh faces: Mr Brown, a little-known state senator, and Mr Gomez, a private-equity guy with scant experience of politics.

Most strikingly, neither race has been as easy as Democrats expected. Barack Obama carried Massachusetts by almost 26 percentage points in 2008 and 23 last year. All nine of its seats in the House of Representatives are Democratic. Before Mr Brown, it had not sent a Republican to the Senate since 1972. Yet Mr Brown won, and several polls have put Mr Gomez only marginally behind Mr Markey.

Like Mr Brown, an affable ex-model who campaigned from his pick-up truck, Mr Gomez has an appealing story. The son of Colombian immigrants, he says he learned Spanish before English. He spent nine years in the navy, first as a pilot, then as a member of the SEALs, a commando unit. He attended Harvard Business School and made a modest fortune. At 47, he is 19 years younger than Mr Markey.

Mr Gomez portrays his rival as a tired Washington hack, with little to show for a lifetime in office and no inclination to buck his party. If Mr Markey wins, Mr Gomez quips, the only change in Washington would be the relocation of his office from the Rayburn building to the Russell building. Mr Gomez paints himself, in contrast, as an outsider willing to shake up Washington. He wants to impose term limits on congressmen, stop their pay if they fail to pass a budget on time and ban them from becoming lobbyists when they retire.

Mr Gomez says he is independent: he supports gay marriage, and wants to close the “gun-show loophole” by requiring background checks for those who buy weapons at such events. He describes the right to abortion as “settled law” and called the author of a recent, doomed Republican drive to restrict it to the first 22 weeks of pregnancy a “moron”. He says he believes in global warming, but opposes the cap-and-trade scheme for greenhouse gases Mr Markey has pushed to curb it.

All this still leaves Mr Gomez to the right of most voters in Massachusetts. He opposes a ban on assault rifles. He would consider abolishing popular tax deductions, including the one for mortgage interest. He supports cuts to Social Security (public pensions) and demurs when Mr Markey calls for higher taxes on the rich.

Mr Markey dismisses Mr Gomez as just another Republican. He implies that he grew rich by exporting American jobs. Mr Markey has a bigger megaphone: he spent $5.9m in April and May, to Mr Gomez’s $1.6m, and had another $2.3m in the bank at the beginning of June, compared with $1m for Mr Gomez. Spending by “independent” outside groups favours Mr Markey even more lopsidedly.

Democrats are determined not to be caught off-guard again, as they were in 2010. Mr Obama stumped for Mr Markey in mid-June. The campaign has been feisty. A Markey ad sought to link Mr Gomez’s pro-gun policies in voters’ minds to a school massacre. Mr Gomez called Mr Markey “pond scum”.

Massachusetts’s romance with Mr Brown proved short-lived. Last year voters dumped him for a banker-bashing academic, Elizabeth Warren. But Mr Obama was on the ballot last year, luring Democrats to the polls. This month, he will not be. Polls show Mr Markey’s lead in the high single digits. That should be enough to win, but not enough to dispel Mr Gomez’s charge that Mr Markey is an uninspiring standard-bearer of the status quo.