It’s been more than 20 years since a Democrat was elected to statewide office in Texas. Still, this year, our state is having a competitive Senate race.

Much of the credit for that goes to Beto O’Rourke, the Democratic candidate.

O’Rourke, who represents El Paso in Congress, should still be considered an underdog. And many observers thought he underperformed expectations in last month’s primary. Statewide, he won just 62 percent of the vote, and he lost a number of counties to Sema Hernandez and Edward Kimbrough, his virtually unknown opponents.

But on Tuesday, O’Rourke’s campaign revealed that he had raised $6.7 million in the first quarter of 2018. That’s more than any other Democrat running for Senate, this year — and it’s an eye-popping figure, even considering the size of the state.

Read more: Texas Republicans can’t coast to victory this year

O’Rourke pledged, at the beginning of the campaign, not to accept donations from corporate political action committees. The funds he’s raised, since the year began, came from some 141,000 individual donors, who chipped in an average of $40 each. That’s a measure of enthusiasm for his candidacy, and one his opponent, Ted Cruz, should be taking seriously.

But Cruz — who won the Senate seat in 2012, after pulling off his own upset for that year’s Republican nomination — deserves some credit for this surprisingly competitive landscape, too.

Publicly, Cruz has expressed confidence in his ability to deal with the threat that O’Rourke represents. But Monday, at his campaign kickoff party at the Redneck Country Club in Stafford, he debuted an ad warning Texas Republicans against being complacent about it.

The ad is set in the near future, and features a bleary-eyed young man trying to make sense of the new political landscape.

“DEMOCRATS TAKE CONTROL,” blares the front page of a mock edition of the Houston Chronicle, sitting on his coffee table. A television news anchor explains that Nancy Pelosi, being accordingly emboldened, has announced her plan to divert all border wall funding to Planned Parenthood.

A noise outside catches the young man’s attention. He opens the front door to see an apocalyptic landscape. And then, much to the man’s relief, he wakes up from this nightmare.

It’s a funny ad, but a revealing one. As Texas Southern University’s Jay Kumar Aiyer pointed out, while he and I were chatting this week, it suggests that Cruz would like to turn this race into a referendum on the national parties.

That was an astute observation, and it would be a shrewd move on Cruz’s part. If the race is framed that way, he would be able to dodge the question of whether he or O’Rourke is best equipped to represent Texas in an era when the figure who dominates the political landscape is Donald Trump.

Read more: Census questions about citizenship would be bad for Texas

The president is a Republican, of course, and in 2016 he was the alternative to Hillary Clinton. Many Texans voted for him on that basis; he carried the state’s electoral votes by nine points.

But Clinton isn’t on the ballot this year. And Texans who vote in this year’s general election may have some objections to decisions that have been made in Washington lately, even if they continue to approve of Trump.

“HAPPY EASTER!” tweeted Trump, bright and early on Easter morning.

The president then launched into a tirade about immigration, border security and trade that has lasted for days.

Along the way, Trump intermittently turned his focus to other antagonists, including the Department of Justice, the FBI, Amazon, the Washington Post, and “Fake News Networks.” But none of them held his attention for very long.

Long story short, Trump has, over the past few days, declared that the effort to find a legislative solution for Dreamers is dead, threatened to withdraw from NAFTA, and vowed to send troops to the border in response to Mexico’s ongoing refusal to pay for his proposed border wall.

The president also responded defiantly to the news that China intends to impose tariffs on 106 products it imports from the United States, in response to new tariffs on imports from China that Trump called for last month.

“We are not in a trade war with China,” Trump tweeted on Wednesday.

“That war was lost many years ago by the foolish, or incompetent, people who represented the U.S.,” he explained.

Read more: Tariffs could jeopardize Trump’s greatest achievement

It’s only the middle of the week, and luckily, none of Trump’s tweets carry the force of legislation.

They do have real consequences, though. On Wednesday, the Department of Homeland Security confirmed that the president would ask border-state governors to activate the National Guard. Texas Gov. Greg Abbott quickly confirmed that he was on board with the plan.

“Today's action by the Trump administration reinforces Texas' longstanding commitment to secure our southern border and uphold the rule of law, and I welcome the support,” Abbott said in a statement.

And Trump’s tantrums this week help explain why Texas, after years as a safe red state, is going to have a surprisingly competitive Senate race.

O’Rourke has inspired genuine enthusiasm among voters across the state. Cruz, for his part, has been reluctant to criticize Trump — or even to disagree with him, as he did during the presidential race. Texans seem to have noticed that, too.