Texas Republicans refuted talk of a coming "blue wave" on Tuesday by flipping a state senate seat that had long been held by the Democratic Party.

Republican Peter Flores, a retired game warden, pulled an upset win in a special election for Texas’s 19th Senate District over the Democratic nominee, former congressman Pete Gallego. The district, which contains all or parts of 17 counties and spans 35,000 square miles—400 of which are on the border between the United States and Mexico, is one of the largest legislative jurisdictions in the country and until recently one of the most Democratic in Texas.

Flores, who waged an unsuccessful campaign for the seat in 2016, ran a strong race emphasizing his law enforcement background and conservative credentials. Gallego, on the other hand, was forced to fight off attempts to paint him as a "career politician" and faced lingering questions over his residency in the district.

The Republican candidate also benefited from a united front within the Texas GOP with Gov. Greg Abbott, Lt. Gov. Dan Patrick, and both of the state's U.S. senators lending their support. Final tabulations for the race showed Flores handily beat Gallego, capturing around 53 percent of the total vote, by running up margins in the district's more rural and conservative regions.

The seat became vacant earlier this year after the long-serving Democratic state senator, Carlos Uresti, resigned upon being convicted of 11 federal felonies relating to his alleged involvement in a Ponzi scheme. Uresti's departure triggered a special election, the first round of which was held in July.

Flores came in first during the initial vote garnering 34 percent of the ballots cast. Gallego and another Democratic contender finished in second and third place, with a combined vote total of 59 percent. Since no candidate received over 50 percent of the vote outright, a runoff between Flores and Gallego was scheduled for September.

It was predicted that Gallego, who represented large swaths of the 19th Senate District in both Congress and the state House of Representatives, would sweep to victory in the runoff given the Democrat's voter registration advantage. The former congressman confirmed as much during an interview with San Antonio Express-News in August.

"Just empirically, it's a Democratic district. Assuming we do our job of getting Democrats out to vote, we win in the end," Gallego said at the time.

Indeed, it appears Gallego's candidacy failed to energize a sufficient portion of the Democratic base. Overall, turnout was proportionally higher in the district's Republicans areas than in heavily Democratic strongholds such as urban Bexar County, home to San Antonio, according to the Texas secretary of state's office.

Gallego's loss was surprising given that Democratic presidential nominee Hillary Clinton carried the district by nearly 12 percentage points in 2016, while Uresti defeated Flores by 15 points to secure re-election. Prior to Flores's triumph on Tuesday, the district had not elected a Republican since the era of reconstruction.

The Gallego campaign did not return requests for comment on this story.

Apart from becoming the first GOP member to hold the seat in 139 years, Flores will further have the distinction of being the Texas Senate's first Hispanic Republican. The senator-elect told the Washington Free Beacon he was honored by the trust voters had placed in him and that he would work hard to "not let them down."

"I will work hard to represent them and look forward to passing meaningful property tax reform, supporting our energy industry … and defending innocent life and the 2nd Amendment in the [coming] legislative session," Flores said. "I am grateful to Gov. Greg Abbott, Lt. Gov. Dan Patrick, and everyone who helped us. The real work begins now!"

Flores's win bolsters the standing of Republicans in the Texas Senate. Currently, the GOP has a supermajority within the chamber allowing it to bring legislation to the floor for a vote without any Democratic support. With Flores assuming the remainder of Uresti's term, which isn't scheduled to end until 2021, the GOP is likely to keep its supermajority, regardless of the outcome this November as there are few competitive seats in contention.

Republican success in the 19th Senate District could also foreshadow the results of this year's midterm elections. National Democrats have been giddy about their chances in the Lone Star state, especially in contests for the U.S. House and Senate.

A prime target for Democrats has been incumbent Republican congressman Will Hurd in Texas's 23rd Congressional District. Hurd, a moderate Republican and former intelligence officer, was first elected to the House of Representatives in 2014 after unseating then-congressman Gallego by less than 2,500 votes. In 2016, Gallego sought a rematch against Hurd but failed to reclaim the seat, despite Clinton carrying the district at the presidential level.

This cycle, the Democratic Congressional Campaign Committee put Hurd within its sights, labeling the district a must-win if Democrats want to retake the House majority.

Tuesday's results, however, seem to indicate a more favorable landscape than anticipated for Hurd, whose congressional district encompasses much of the same territory. Flores, in part, was able to secure victory by stressing Gallego's ties, formed during his brief tenure in Congress, to House Minority Leader Nancy Pelosi of California. With Pelosi an increasingly unpopular figure, even among fellow Democrats, such tactics are likely to be replicated elsewhere by Republicans.

James Dickey, the chairman of the Republican Party of Texas, told the Free Beacon the GOP's upset pushed back on the narrative that a "blue wave" was inevitable.

"The victory by Pete Flores last night serves as proof that the ‘blue wave' the Democrats have been touting can be stopped dead in its tracks when Republicans turn out to vote," Dickey said. "But last night’s historic win was no accident. It was the culmination of months of collaboration and hard work."

The chairman praised the efforts of all those involved in securing Tuesday's victory, asserting it was further proof a unified Republican front was insurmountable.

"Pete Flores ran a great campaign and traversed the district to meet with voters," Dickey said. "His campaign was organizing volunteers for months. Our statewide leaders, specifically Gov. Abbott and Lt. Gov. Patrick, deployed staff and resources to the district. The State Republican Party dedicated staff and organized volunteers both in the district and around the state the turn out the vote. Republican principles win elections and hard work produces positive results."

"The message is clear," Dickey added. "When Republicans come together, Republicans win."