(Jenny Starrs/The Washington Post)

As James Thompson worked his way through a coffee shop, the Democratic candidate for Congress said something that got people to look up from their laptops.

“We’ve got a lead right now.”

“Really?” said Marla Flentje, a Republican who said she’d voted for him in early balloting.

A trio of Democrats walked over to meet Thompson and tell him they’d vote Tuesday.

“I hope you do, because right now, we’re winning,” said Thompson.

Republican Ron Estes, left, Kansas state treasurer, and Democrat James Thompson, a civil rights lawyer, are competing to replace Rep. Mike Pompeo in a special election in Kansas. Pompeo is now CIA director. (Wichita Eagle via AP)

Thompson was not supposed to win — or even come close — in this largely rural 4th District, which picked Donald Trump for president by 27 points. Rep. Mike Pompeo (R) vacated the seat to lead the CIA, and Republicans expected to hold it easily.

But in the final days before Tuesday’s special election, Republicans reacted to weak polling and turnout data by rushing resources to southern Kansas. A GOP super PAC rolled out robo-calls over the weekend from Vice President Pence, and on Monday from President Trump, in support of candidate Ron Estes.

“Ron Estes needs your vote and needs it badly,” Trump said on the call. “Ron is going to be helping us, big league.”

On Monday, Republicans also dispatched Sen. Ted Cruz (Tex.) for a fly-in, where he urged Kansans to vote “if you’re fed up with the stagnation under the Obama economy.”

Late Monday, the national House Democratic campaign arm announced that it was calling 25,000 households to counter the GOP influx. Readers of the liberal Daily Kos donated a total of $149,000 to Thompson over the final weekend.

This — the home town of Koch Industries — is the last place the GOP expected to have to undertake a rescue mission. The Kansas seat is one of the reddest of the five House seats vacated in the Trump era, four of them by Republicans who joined the new administration. If Thompson ends up winning here, the national Democratic Party will claim the victory as a portent of bad things to come for Republicans in the 2018 midterms with Trump in the White House.

Democrats also have an opportunity in Georgia’s 6th District, where Jon Ossoff is surging in the race to replace former congressman Tom Price (R), who is now health and human services secretary.

In Kansas, Thompson, a civil rights lawyer who supported Sen. Bernie Sanders (I-Vt.) in the 2016 presidential caucuses, flew under the radar for weeks. Meanwhile, Estes, the state treasurer, got bogged down as his party staged an unsuccessful rebellion against deeply unpopular Gov. Sam Brownback (R). Estes rarely mentions Trump, but he did reference “fair trade” at the Cruz rally, smoothing over an issue that divides Kansans.

As the race has tightened, Republicans, who are still favored to win Tuesday, have strained to make the election a referendum on liberalism. Brownback, invisible on the trail, didn’t help matters by vetoing a bipartisan Medicaid expansion bill last month; his most favorable polling puts his job-approval rating below 25 percent, even in the 4th District.

In November, as Republicans were scoring upsets around the country, they lost three state House seats in the Wichita area. Several more-conservative Republicans lost primaries to moderate candidates.

“People here still like Trump,” said Thompson, whose campaign signs identify him not as a Democrat but as an Army veteran. “It’s not been a referendum on him. It’s a referendum on the failed Republican leadership in the state. People don’t want these policies taken to the national level.”

In Wichita, where turnout in early voting has been high, Brownback’s name has the force of an epithet. As she settled in for lunch at the Anchor, a downtown gastropub where Thompson stopped to shake hands, Kayla Marshall said she didn’t vote in the 2016 election. She would, she said, vote for Thompson — and to explain why, she talked about teachers buying pencils with their own money because Brownback had cut the education budget.

Lynn Jones, who opened his door to Thompson canvassers Monday morning, was quick to say he’d voted for George W. Bush. Brownback, he said, was nothing like Bush.

“Okay, he was trying something new with his tax cuts, but the experiment didn’t work,” Jones said. “When the laboratory explodes, you probably ought to try a different formula.”

Thompson, a first-time candidate, was generally ignored by both parties for most of the race. When his campaign asked the state Democratic Party to fund a mailer, it was turned down, later investing just $3,000. In an interview last week, Democratic National Committee Chairman Thomas Perez said the national party would not be transferring any late money.

“We can make progress in Kansas,” Perez said. “There are thousands of elections every year, though. Can we invest in all of them? That would require a major increase in funds.”

Thompson spoke before Sanders at a February rally and has been endorsed by Sanders’s group, Our Revolution. According to recent fundraising reports, Estes has raised $459,000 to Thompson’s $292,000. Outside groups, which are pouring money into Georgia ahead of the April 18 contest there, have left Kansas alone.

“The Democrats think so much of their candidate there that they’ve spent zero dollars,” said Corry Bliss, executive director of the Republican-allied Congressional Leadership Fund. “We’ll win the Kansas election by double digits.”

His group is now funding robo-calls targeting local Republicans, who outnumber Democrats but have been sluggish to turn out. The National Republican Congressional Committee has spent close to $100,000, multiplying Estes’s presence on the airwaves.

Thompson’s campaign reacted with delight to the robo-calls, viewing them as not just ineffective but as sign of his viability.

Because he’s getting so little attention — no trackers from the other party were following him Monday — Thompson talked freely with a voter concerned about abortion, agreeing that society should do more to lower abortion rates. He dismissed a last-minute TV ad accusing him of favoring abortions for sex selection as representing his views to a “ludicrous and false extreme.” His final TV spot featured him shooting an AR-15 as a narrator called him a “fighter who grew up in poverty,” but the National Rifle Association was not on the air to contradict him.

What was on the air for Estes was rote — and telling of how Republicans have struggled to find a pro-Trump rallying cry. One of Estes’s first commercials featured him in waders, joking that “after eight years of Obama, America is weaker and the swamp is deeper than we thought,” as an alligator poked its head up for emphasis.

Democrats haven’t won here since the early 1990s; then-Rep. Dan Glickman (D) was swept out by a Republican wave in 1994. Glickman vastly outspent his opponent, but the Republicans made up for it with a grass-roots surge of antiabortion activists. In 2014, when Bliss helped Sen. Pat Roberts (R) secure victory, he got a similar late-game boost from social conservatives.

Those wins came when Democrats controlled the White House. On Monday, when more than 150 Republican voters piled into the Estes-Cruz rally, some wore anti-Hillary Clinton merchandise; all cheered when Cruz recalled how his “lips curled into a smile” when he saw a Democratic colleague mourn Clinton’s defeat.

The cheering was quieter when Cruz and Estes described the stakes of the election. They spoke generally about repealing the Affordable Care Act, though Estes said he opposed the GOP replacement bill that fizzled last month. Cruz talked up tax reform by staging a contrast: “Unlike Obamacare, I’m convinced we can get it done.”

Estes, meanwhile, packaged himself as an agent of common sense and disruption, without mentioning the work he’d done with Brownback. “I’m going to Washington to change Washington,” he said. “When I go to Washington, I want to get to a balanced budget.”

The Republican majority that Estes would join does not have a balanced-budget plan.

In interviews at the rally, Estes’s voters said they were thrilled that Neil M. Gorsuch had been confirmed to the Supreme Court, but they had little else to say about Congress. Asked what he thought of House Speaker Paul D. Ryan (R-Wis.), John Bernhardt, who sported an early-voting sticker on a red-white-and-blue polo shirt, answered with a grimace.

“Can I plead the fifth?” he said.

Joyce Wallace, who got a plum position near the rally stage, said she had no qualms about sending a Trump ally to Washington.

“I’m all for Trump,” she said. “I think he’s fulfilling his campaign promises.”

Not every Republican at the event agreed. Cathy Dowell, who like Wallace had caucused for Cruz in 2016, worried that Trump went back on a campaign pledge by attacking a Syrian airfield.

“I’m a little worried about Trump,” Dowell said. “I know he’s not a conservative, and I think he’s making a mistake in Syria.”

But the two Republicans found something to agree on: Both would be happy if Carl Brewer, the Democrat who just finished two terms as mayor of Wichita, replaced Brownback in the governor’s office.