ALBANY, N.Y. (AP) — Republican U.S. Rep. Claudia Tenney formally conceded to Democrat Anthony Brindisi on Wednesday to end an upstate New York congressional race settled by absentee ballots three weeks after election day.

In an email sent to reporters, Tenney wrote that serving her single term in the House was a "tremendous honor" and vowed to work with Brindisi to ensure a smooth transition.

"As the votes have been counted the last several weeks, it has become clear that while we remain on the right side of the issues and history, we came out on the wrong side of a very close race," Tenney wrote in the email.

Brindisi, a 40-year-old state assemblyman from Utica, campaigned on calls for civility and bipartisanship. Tenney's staunch support for President Donald Trump proved insufficient, even though the district strongly backed Trump in 2016.

Brindisi was ahead by less than 2,000 votes on election night, leading to a long wait as local election officials tallied up absentee ballots. As of Wednesday, Brindisi's lead had grown to nearly 4,000. While the results from 1,881 remaining ballots have yet to be reported, Brindisi's lead made it mathematically impossible for Tenney to prevail.

Brindisi had already begun preparing for his new role and participated in orientation for freshmen members of Congress in Washington.

Republicans outnumber Democrats in the district, which includes dairy farms and struggling former manufacturing towns such as Binghamton and Utica. Voters there favored Trump over Hillary Clinton in 2016 by 16 percentage points.

Trump's margins in 2016 meant that to win the district, Brindisi had to appeal to independents and Republican moderates.

"I'm going to work on issues just as hard for people who did not support me as for those who did support me," Brindisi said Monday during an interview with WKTV-TV.

Republicans fought hard to defend Tenney, 57, an attorney and former state lawmaker. Trump, his son Eric and House Speaker Paul Ryan all visited the district to raise money or campaign.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.