SALT LAKE CITY (AP) — Democrat Ben McAdams has flipped a U.S. House seat in deep-red Utah, defeating incumbent Republican U.S. Rep. Mia Love by fewer than 700 votes in a race that took two weeks to settle.

Final results posted Tuesday showed McAdams defeated Love by a margin barely over what would have been needed to require a recount.

McAdams’ victory adds to the Democratic majority in a year when they’ve flipped more than three dozen Republican-held seats across the country to win control of the House of Representatives.

The back and forth race in Utah had been too close to call for The Associated Press until the final votes were tallied. State election officials will certify the results next Monday.

McAdams declared victory Monday night after a release of ballots gave him a margin his campaign believed was insurmountable.

“This race was about connecting with Utah,” he said. “This race was about who was best positioned to serve Utah and working to not get it caught up in a national, partisan election.”

Love did not immediately respond to a request for comment.

He pitched himself as a solid moderate, and not a typical Democrat, while calling Love a partisan who almost always votes with the president. The strategy was aimed at independent voters who account for nearly four in 10 voters in the largely suburban district, and designed to overcome his built-in disadvantage in a district where registered Republicans in the district outnumber Democrats by nearly 3-to-1.

He is an attorney who graduated from Columbia Law School and practiced in New York before returning to his home state of Utah. He has been a political figure in the state for a decade. He was elected as one of the few Democrats in the GOP-dominated state Legislature in 2008 and successfully ran for the Salt Lake County mayor’s seat four years later.

He became known for working with the state’s Republican leaders on issues like homelessness, where he backed a narrow Medicaid expansion to cover treatment and once went undercover as a homeless person when the issue reached crisis mode downtown.

Though solidly conservative, Utah voters have long been uncomfortable with Trump’s brash style and his comments about women and immigrants. That anxiety is especially pronounced in the suburbs of blue-leaning Salt Lake City, and McAdams’ mayoral position gave him solid name recognition with voters.

McAdams said during the campaign he would not support California Rep. Nancy Pelosi as House Speaker and insisting he’d be able to work with the president. He sharply criticized Love’s support for the GOP-backed tax overhaul and said she had not been available enough to her constituents at town halls.

He has already signed a letter along with 15 other Democrats vowing to oppose Pelosi.

Love pushed back hard, saying the tax overhaul has been good for people in Utah and defending her approach of meeting with voters in smaller groups, on the phone or online.

She highlighted the times she’s stood up to the president, like when Trump used an expletive to describe her parents’ home country of Haiti. She tried to separate herself from Trump on trade and immigration.

Trump didn’t appreciate her approach, calling her out by name in a news conference the morning after Election Day, where he also bashed other Republicans who he said lost because they didn’t fully embrace him.

This is the second time Love was locked in a tight, drawn-out race for this House seat. In her first bid for Congress in 2012, Love lost to incumbent Democrat Jim Matheson by 768 votes. She went on to defeat Democrat Doug Owens in 2014 and again in 2016.