PHOENIX (Reuters) - The Republican candidate prevailed in a special Arizona election for a vacated U.S. House of Representatives seat after a tight race that some observers said could still bolster Democratic momentum heading into November’s midterm vote.

Republican Debbie Lesko, a former Arizona state senator who campaigned as a strong supporter of President Donald Trump’s agenda, declared victory late on Tuesday. Her Democratic rival, former emergency room doctor Hiral Tipirneni, congratulated Lesko on Twitter on Wednesday but vowed to challenge her again when she is up for reelection in November.

Lesko prevailed by about 5 percentage points, a relatively narrow margin in a deeply Republican district that Trump carried by more than 20 points in 2016.

The race was the latest of several closely watched special elections ahead of November’s contests. Democrats are aiming to pick up 23 seats nationally to reclaim control of the House and two seats to regain a majority in the Senate.

The party has been buoyed by some recent wins in Republican strongholds, including Conor Lamb’s victory last month in a House district in a conservative corner of Pennsylvania, and losses by smaller-than-expected margins in other races.

Electoral analysts said the close race was further evidence that Republicans face strong political headwinds this year, in part thanks to Trump’s low approval ratings.

“If the only data point you had to go on was last night’s #AZ08 result, you’d think a 30-40 seat Dem House gain in Nov. would be way low,” David Wasserman, the chief House expert at the Cook Political Report, a nonpartisan election analysis group, wrote on Twitter.

Trump, a fellow Republican, praised Lesko’s “big win” in a Twitter post.

“Debbie will do a Great Job!” wrote Trump, who also recorded a supportive robo-call for Lesko.

Republicans issued a statement touting Lesko’s win as evidence that resources invested in the race paid off.

“The NRCC was proud to support her and our targeted and early investments proved to be a difference maker,” said Steve Stivers, chairman of the National Republican Campaign Committee, which supports the party’s House candidates.

The Democratic Party’s congressional campaign arm said in a statement that the results should “terrify” Republicans.

“Republicans shouldn’t have had to spend a dime to hold this district, and yet they poured in more than a million dollars because their candidate couldn’t separate herself from the toxic Washington Republican agenda,” spokesman Jason Peters said.

The person who previously held the seat in Arizona’s 8th district, Republican Trent Franks, resigned on Dec. 8 after 15 years in office amid allegations that he made improper advances to female staff and that he offered a female staff member $5 million to be a surrogate to bear a child for him and his wife. He denied any wrongdoing.

Lesko supports Trump’s proposal for a border wall between the United States and Mexico, opposes abortion and is a staunch gun-rights advocate.

Tipirneni focused her campaign on the need to improve healthcare, including expanding Medicare by allowing anyone to buy into the system.