NEW CANAAN — Tom O’Dea, R-125, will be headed to Hartford for another two years, but he faced a closer race than in his previous elections.

According to unofficial results from the Republican Town Committee, O’Dea won with 5,758 votes against Democratic candidate Ross Tartell, who obtained 4,235 votes and also won Wilton.

The incumbent celebrated his victory along with other Republicans at their traditional election night spot, the Roger Sherman Inn in town but as the night went on, the mood became one of concern as fellow Republican incumbents lost their spots to Democratic challengers.

“A win is a win,” O’Dea said after learning about the unofficial results. “I’m curious about Wilton, but Tartell is a Wilton guy and campaigned like a Wilton guy.”

Tartell called O’Dea around 10 p.m. Tuesday to concede.

“I feel really good about the race we ran,” Tartell said in a phone interview. “We had key points about running this race. The numbers and the history were stacked against us but our race changed lives. We proved we could run a race that would make Tom run, show the power of a strong Democratic race and demonstrate the power of competence over ideology and values over venom.”

According to unofficial results, Tartell won Wilton by just over 200 votes. O’Dea won New Canaan with over 1,700 votes.

This was the first time O’Dea had seen Democratic opposition since he ran for the General Assembly in 2012, and it is also one of the closest races he’s faced.

O’Dea’s Republican colleagues in the area like state Rep. Fred Wilms and Sen. Toni Boucher all lost their spots in the general assembly, a surprise to many of the Republicans in the room.

O’Dea focused his campaign on cutting taxes and reducing spending. He has openly advocated for eliminating the pension, estate and income taxes.

Throughout debates and interviews, O’Dea has proposed making a 20 percent cut across the board for all state departments with the exception of the developmental services department.

Tartell was the underdog in these elections, particularly campaigning in a district with heavy Republican numbers and also where unaffiliated voters form a major component of both New Canaan and Wilton.

Though the Republican and Democratic candidate agreed public-private partnerships should be strengthened, there was little common ground between them regarding taxes and other issues.

In 2016, O’Dea garnered 88 percent of the votes — or 9,261 according to the secretary of the state’s office — when running against Green Party candidate Hector Lopez.