WHITE PLAINS - State Sen. George Latimer won election as Westchester County executive Tuesday, unseating two-term incumbent Rob Astorino in a result some say was a referendum on President Donald Trump.

"Democrats, a mighty wave has hit Westchester County," Latimer told enthusiastic supporters gathered at The Coliseum bar.

Latimer, a Democratic Rye state senator, emerged victorious after a bitter and expensive campaign where Republican Astorino's campaign outspent him by a 3-to-1 margin up until the latest campaign filing period.

EDITORIAL: Latimer's just-right timing helps launch Dems back into Westchester exec seat

USA TODAY: Virginia, NJ voters pick new Democratic governors, set the tone for 2018

RESULTS: Con-con, county and local races

TRUMP: POTUS casts shadow on Westchester executive race

Latimer won 57-43 percent over Astorino with 100 percent of districts counted early Wednesday morning.

The mood was muted from early in the night at the Crowne Plaza Hotel, where Astorino gave his concession speech.

"It has been my honor to serve as county executive, I can't think of a better honor, and I will continue to be and have the honor of being your friend and your neighbor," he said, pledging "100 percent" support to Latimer during the transition.

Latimer has never lost an election in three decades serving as a Rye city councilman, Westchester County legislator and in both the state Assembly and Senate.

During the campaign, Latimer tapped into anti-Trump sentiment in a county where Democrats outnumber Republicans 2-to-1. He criticized Astorino for support of Trump and went after a $1 million donation to a pro-Astorino PAC from Trump supporter and Breitbart funder Robert Mercer.

Astorino, in his concession, thanked members beyond his own party, saying he received votes from Democrats and independents as well.

"You know we could not have won these past two terms without cross-party support and for the past 8 years I've been very very humbled by your confidence in me," he said.

A ballot proposition that would've allowed for a state Constitutional Convention was strongly opposed by labor unions, which also may have sparked turnout. That proposition failed 80-20 percent in the county.

Some viewed the result of the Westchester race as a bellwether over if anti-Trump fervor would have a tangible effect on local elections. Latimer's victory and other Democratic victories in the county show an energized progressive movement overwhelming Republican candidates.

Latimer described the results as a message sent.

“You’ll have to interpret what’s happening outside of Westchester, but what happened in Westchester is clearly a wave, and it was reflected in municipal races as well as in the county races," Latimer said.

Democrats also scored big victories on the 17-person legislature, with at least three incumbent Republicans appearing to have lost their seats to Democratic challengers. Those victories will give Democrats a supermajority on the board and change the leadership structure of the board.

They also won big races in local towns and cities, including Latimer's home town of Rye.

The campaign was marked by a saturation of ads, heated debates and a feeling from both sides that the result could be close. A snap poll sponsored by lohud and TV station RNN last week showed a dead heat between the candidates, with Latimer up slightly but within the poll's margin of error.

Astorino had hammered Latimer over more than $46,000 in unpaid taxes on a home owned by Latimer’s wife. Latimer was also dogged by the revelation he’d accumulated more than $2,000 in unpaid parking tickets and admitted driving an unregistered car after denying he had driven it.

Astorino faced his own issues during the campaign, with a witness in a New York City trial testifying he’d bought influence with Astorino through campaign donations and by helping him get a Rolex watch.

Latimer said the two would put the race behind them. Astorino had called to congratulate Latimer prior to giving his concession speech.

Astorino said he and Latimer had been friends and now that the heat of the campaign was over, they could be friends again. Latimer described Astorino as "gracious" in his congratulations.

"He sent best wishes to me and I told him that I look forward to working with him in the transition period and we’re both happy that the campaign is over," Latimer said.

The county executive serves a four-year term and is paid an annual salary of $160,760.

Twitter: @marklungariello