MASHANTUCKET - Republicans rallied behind former Meriden mayor Manny Santos last Friday as their choice to run for U.S. Rep. Elizabeth Esty’s seat in Connecticut’s 5th District.

But enough Republican delegates at the party’s convention supported Southbury political newcomer Ruby O’Neill to force a primary in August, setting the stage for a summer campaign battle for what is traditionally Connecticut’s most competitive Congressional seat.

“The delegates recognize that I am a strong candidate,” Santos said after the vote at Foxwoods Resort Casino. “Now it is up to the rest of the Republicans in the district, but I am happy with this

result.” Santos, a mechanical engineer who entered the race in February before Esty’s office abuse scandal forced her to drop a run for a fourth term, won 135 votes out of 246 cast, more than the necessary 50 percent to win the nomination.

“Thank you for showing your support for me, and for your confidence,” Santos said to delegates.

Santos will spend the warm weather months seeking support from Republicans in the 36 towns and five cities of the 5th District, which stretches from Bethel to the Massachusetts border, and from New Milford to New Britain.

O’Neill, a retired psychology professor and the vice chair of the state Commission on Equity and Opportunity, declared her candidacy only two weeks ago. But she had the support of state House Republicans, including Rep. William Petit, the survivor of the 2007 Cheshire home invasion, who briefly entertained thoughts of running for Esty’s seat.

“I am very happy that they want to take the Connecticut GOP in a new direction,” O’Neill said shortly after the vote. “I am thrilled.”

The delegates needed two ballots to choose a nominee.

On the first ballot, Santos received 117 votes, O’Neill received 87 votes and Richard Dupont, a Watertown businessman, received 36. Santos finished just shy of the 50 percent needed for the nomination.

The GOP convention, which will choose the Republican gubernatorial nominee on Saturday, comes two days before the Democrats nominating convention for the 5th District on Monday in Waterbury.

Democratic hopefuls include Mary Glassman, a former Simsbury first selectman who has raised $100,000, and Jahana Hayes, a Waterbury high school teacher who won the 2016 National Teacher of the Year Award.

Although Republicans are expected to have a better of chance winning the 5th District than they had when Esty and her $1.5 million were still in the race, it will still be an uphill battle for the GOP in a district where only 24 percent of voters are Republican.

More than 32 percent of the district’s 417,000 are Democrats, and more than 42 percent of voters are unaffiliated.

GOP Chairman J.R. Romano said Republicans had confidence about winning a district that the GOP last held in 2006.

“The last thing this state needs is to export Dan Malloy’s policies to Washington D.C.,” said Romano, referring to the outgoing Democratic governor. “And that is exactly what voters would be doing if they elect a Democrat to represent the 5th.”

Esty’s decision to drop her re-election bid heightened interest in a race where there was already increased attention because of the mid-term elections. The Cheshire Democrat dropped out of the race after admitting that under her watch, female employees in her Washington, D.C., office were harassed by Esty’s former chief of staff.

Her scandal-fueled exit from the race caused both parties to scramble for candidates. Republicans urged Petit and former Newtown First Selectman Pat Llodra to run, while Democrats asked Sandy Hook Promise co-founders Nicole Hockley and Mark Barden to consider a run. All four declined.

Other Republicans who declared an interest in Esty’s seat were Elizabeth Peterson, of Simsbury, and John Pistone, of Brookfield.