Incumbent Democrat Rep. Pete GallegoPete Pena GallegoER doctor chosen to lead Hispanic Caucus 4 Texas GOP congressional primary runoffs to watch GOP candidate scores upset win in Texas state Senate runoff MORE lost a tight bid for reelection in Tuesday's midterms to Republican Will Hurd, an African-American former CIA officer.

Gallego, a freshman lawmaker, trailed Hurd for most of the evening, eventually losing 50 percent to 47 percent, a difference of about 2,000 votes in the sprawling Texas district.

ADVERTISEMENT

Hurd will become the first black lawmaker from the district since Reconstruction, according to news reports.

In a statement, Gallego congratulated Hurd and said he will “embrace the will of the voters in this election.”

“Texans deserve far better than what Congress has been giving them and I intend to provide Will any and all help I possibly can to help him work to correct that problem as he prepares to take office,” Gallego said.

Texas will send three freshmen to Washington in a delegation made up of 25 Republicans and 11 Democrats.

The 23rd District, which has flipped between the parties in the past three elections, was the most closely contested in the Lone Star State.

The district, which is 70 percent Hispanic, is massive and stretches hundreds of miles, from San Antonio to El Paso.

There was concern around the race that a new voter ID law could affect a hefty percentage of voters in the area. But Gallego said his campaign had canvassed the district to inform voters about the new law and make sure they were ready. 

The 37-year-old Hurd is a former CIA officer who spent time undercover in the Middle East.

The two candidates had similar views on a number of issues, especially foreign policy.But immigration and border security remain a top priority for voters in a district that runs along the Mexican border. 

The candidates had to balance being tough on illegal border crossings with the idea that the United States is open to immigrants and has been for generations. 

Gallego said his son is a 10th-generation Texan, according to news reports, noting that many families had long ties to the state.