Gabriel E. Gomez, a businessman making his first run for higher office, won the Republican senatorial primary Tuesday, scoring an upset victory that has the potential to draw major national interest as he prepares to face Edward J. Markey, a veteran congressman who rolled to a win in the Democratic contest.
Gomez, a 47-year-old private equity investor from Cohasset, used his fundraising advantage to soundly defeat Michael J. Sullivan, a former state and federal prosecutor considered the front-runner for the GOP nomination. Daniel B. Winslow, a state representative and former district court judge, ran a distant third.
Markey, 66, the choice of the Democratic establishment who has been in the House for 36 years, built on his strong support in the party’s base of progressive activists, rolling up wide margins in liberal communities to defeat US Representative Stephen F. Lynch, who courted conservative Democrats and independents.
With 99 percent of precincts reporting, Gomez was leading Sullivan, 51 percent to 36 percent, with Winslow at 13 percent.
Markey was up 58 percent to 42 percent over Lynch, with 99 percent of precincts reporting.
The party’s two nominees, appearing at their victory parties, immediately hit the themes that are expected to dominate the sprint to the June 25 general election.
Gomez, speaking to a small crowd at the Red Lion Inn in Cohasset, mocked Markey as a creature from the era of 8-track tapes who was first elected to Congress in 1976, when Gomez was still playing Little League.
“If you are looking for an independent voice, a new kind of Republican, take a look at our campaign,” he declared.
Markey, joined by Senator Elizabeth Warren and other senior Democrats, struck back at the Omni Parker House. He called on Gomez to abide by the pledge that Scott Brown signed in his race against Warren to keep special interests out of the campaign. Markey and Lynch signed a similar pledge in their primary fight.
“The people of Massachusetts want this to be a special place,” he said. “I don’t think they want Gabriel Gomez or anyone else bringing in this special interest, undisclosed, unlimited money from around the rest of our country and polluting the politics of Massachusetts.”
Gomez’s come-from-behind victory creates a major shift in what had been a sleepy campaign to replace John F. Kerry, even though the race is one of several over the next two years that may determine control of the US Senate.
With his unexpected victory, Gomez, the son of Colombian immigrants and a former Navy SEAL, now promises to draw strong interest from national Republicans who are looking to rebrand the party as more inclusive of Latinos after a disastrous showing with minorities in last year’s presidential election.
“Gomez’s upset victory suddenly changes the dynamics of the general election significantly,’’ said Lou DiNatale, a veteran Democratic strategist, noting that Democrats had hoped to face Sullivan, whose conservative positions would enable the party to paint him as out of step with the broader electorate. The state party had targeted Sullivan with attacks early in the primary campaign.
Gomez, a social moderate and fiscal conservative, will present a fresh public face for the Republican Party, in sharp contrast to Markey, who is steeped in national battles over gun control, climate change, and abortion rights.
Senior Republicans said Gomez’s victory will ignite a keen interest from the Washington media and put heavy pressure on GOP fund-raisers to pour money into his campaign.
“Gabriel showed today that he has what it takes to do one of the most important things, and that’s to inspire people,” said National Republican Committeeman Ron Kaufman.
But some analysts said his lack of experience as a candidate could be a major vulnerability in a heated campaign.
His only prior run for elective office was an unsuccessful bid for Cohasset selectman.
In January, he wrote to Governor Deval Patrick, asking to be appointed interim senator and pledging to support President Obama’s policies on gun control and immigration. Those positions may have played well in a general election but he renounced those stances to appeal to conservatives in the Republican primary.
“On paper, he may be very attractive,’’ said Tad Devine, a Washington-based Democratic consultant. “But he may be in a role he can’t handle. Like a lot of new candidates, they suddenly burst on to the stage and then quickly fall off the stage.’’
Republican insiders sensed Sullivan’s early lead in the race was eroding over the last week. Gomez, with his personal fortune and ties to the financial world, was able to raise $1.2 million, making him the only Republican with a significant television ad campaign, an advantage that may have proved crucial in helping him to victory.
Several GOP analysts said Sullivan also lost some of the enthusiasm of the social conservatives and Tea Party activists that made up his base of support by ignoring them during the campaign.
Tuesday’s voting ended a truncated three-month campaign to fill the seat that Kerry left in January.
The race was overshadowed by snowstorms and more dire news, including the Boston Marathon bombings just two weeks before the primary.
From the beginning, Markey was the heavy favorite. He was backed by the Democratic Senatorial Campaign Committee, which controls much of the party’s national fund-raising, and endorsed by senior members of the party in Washington and Massachusetts, including Kerry, Victoria Reggie Kennedy, Caroline Kennedy, and Attorney General Martha Coakley.
Drawing on the fund-raising connections he built over 36 years in Congress, Markey raised $4.8 million in the first three months of the year, compared with Lynch’s $1.5 million.
He exploited Lynch’s opposition to Obama’s health care law to blunt his rival’s appeal to core Democratic voters.
He also succeeded in picking up enough support from unions to prevent the AFL-CIO, the state’s umbrella labor group, from uniting around Lynch, a former labor leader and ironworker who was counting on a groundswell of support by labor activists.
Lynch embraced his underdog status and lambasted Markey’s establishment support in an attempt to rally blue-collar voters, conservative Democrats, and independents.
Calling Markey “an insulated person” more connected to Washington than to the struggles of average families in Massachusetts, he spoke frequently, of the 18 years he spent as an ironworker and of his childhood in the Old Colony housing project in South Boston.Eric Moskowitz, Stephanie Ebbert, Joshua Miller, and Katheleen Conti of the Globe Staff contributed to this report, along with Globe correspondent Jeremy C. Fox. Michael Levenson can be reached at firstname.lastname@example.org.