Updated

Republican candidate Debbie Lesko won a special election for a U.S. House seat in Arizona Tuesday night, to replace former Rep. Trent Franks, who resigned in December over sexual misconduct allegations.

Lesko, a former state senator, defeated Democrat Hiral Tipirneni to keep the 8th Congressional District seat in Republican control.

National Republican groups funneled hundreds of thousands of dollars to support Lesko in the hotly contested race that spanned heavily conservative areas of western Phoenix suburbs.

“I congratulate Congresswoman-Elect Debbie Lesko and look forward to welcoming her to our conference,” said Steve Stivers, chairman of the National Republican Congressional Committee. “Debbie is a strong conservative whose values truly reflect those of the voters in Arizona’s Eighth District. The NRCC was proud to support her and our targeted and early investments proved to be a difference maker in the race.”

Earlier in the day, President Donald Trump tweeted his support for Lesko, pointing out her stance on border patrol, immigration and crime.

“Time is ticking down -- get out and VOTE today,” the tweet read. “We need Debbie in Congress.”

Speaker of the House Paul Ryan congratulated Lesko on “her hard-fought victory,” while pointing to the campaign win as a bellwether for the Republican party as they prepare for the midterm elections.

“Her victory proves that Republicans have a positive record to run on this fall and we need to spend the next seven months aggressively selling our message to the American people," Ryan said.

Several Republicans who spoke to the Associated Press said they backed Lesko for her support of the president’s stance on border security, including building a wall on the U.S.-Mexico border – which Tipirneni had opposed.

Lesko also criticized Tipirneni, a doctor, for supporting government-run health care. The Republican beat the Democrat by almost six points in a district where Trump won by 20.

Democrats had hoped to extend a string of special election victories that saw them post victories in Alabama and Pennsylvania.

The Associated Press contributed to this report.