The losses affected Democrats and Republicans. Some of them faced close races, and a couple of upsets came as a surprise to political insiders.

DALLAS — Five incumbent Texas officials lost their primary campaigns for re-election on Tuesday, at least a couple of them surprising political insiders.

Texas state Rep. Steve Toth, R-Woodlands, defeated incumbent Republican Congressman Dan Crenshaw, who was running for his fifth term. Crenshaw had famously clashed with the MAGA supporters. Toth got endorsements from U.S. Sen. Ted Cruz, Turning Point USA and the House Freedom Caucus. Toth got 56% of the vote to Crenshaw’s 40%.

Nate Sheets, endorsed by Governor Abbott, defeated the sitting Texas Agriculture Commissioner Sid Miller. It’s the first time in years that a statewide Republican official has lost his primary race. President Trump endorsed Miller late in the race. Sheets ended up with 52% of the vote to Miller’s 47%.

Despite spending millions, acting Comptroller Kelly Hancock did not win the primary for the permanent position. The comptroller is the state’s chief financial officer and is in charge of managing the Texas school voucher program. Former state Senator Don Huffines handily defeated Hancock and Railroad Commissioner Christi Craddick to avoid a runoff and become the Republican nominee. Huffines dominated with 57% of the vote.

In a surprise to many political insiders, veteran state Rep. Chris Turner, D-Grand Prairie, narrowly lost his re-election to Junior Ezeonu, the Mayor Pro Tem in Grand Prairie. Ezeonu is a young progressive who advocates for increasing the minimum wage and against the new school voucher program. Ezeonu ended up with 52% of the vote on Tuesday.

And Dallas County District Attorney John Creuzot is on track to lose his re-election to former Judge Amber Givens. She leads 51% to 48%. He is behind by more than 7,000 votes.

Givens faced two sanctions from the State Commission on Judicial Conduct for allowing a staff member to stand in for her during a criminal court proceeding nearly five years ago. Givens denied the allegation and is appealing the sanction.