Republicans have held onto the Kansas 4th Congressional District in the special election to replace CIA Director Mike Pompeo, but not by an overwhelming margin.

Republican state treasurer Ron Estes beat Democrat James Thompson by a 7 percentage point margin. Estes lost Sedgwick County, which includes Wichita and its suburbs and cast 68 percent of the district's votes, by just 2 points. But he won by carrying the remaining counties (besides Pawnee County, which cast exactly 62 votes and which I did not count in any of the comparisons below) by a 26-point margin.

Is this something in the nature of a moral victory for Democrats? They hoped for an upset and noted with glee that national Republicans were pouring money into the district, plus a robocall from President Trump. But they weren't really confident in winning a district that had last gone Democratic in 1992, when a moderate Democrat won his last of nine elections. (Dan Glickman, a bright and humorous man, went on to serve as agriculture secretary in the Clinton administration and head of the Motion Picture Association, one of Washington's plum lobbying jobs, from 2004 to 2010.)

A 53-46 loss is a pretty good number for them in a district which Pompeo carried 59-40 in 2014 and 62-36 in 2016, and which Donald Trump carried by 59 to 32 percent.

But it's worth drilling down to understand the election results and the implication, and to compare the results with those in another race — the 2014 contest in which controversial conservative Republican incumbent Sam Brownback won re-election by just 50 to 46 percent statewide.

That result was taken in some quarters as a repudiation of his spending and tax-cutting record. When you take a look at the numbers, you see something perhaps more interesting. Brownback carried 98 of the state's 105 counties, but lost in the counties including Kansas City (industrial), Topeka (the state capital), Lawrence (the University of Kansas) and Manhattan (Kansas State University). He narrowly won in Johnson County, the major affluent suburban county in the Kansas City, Missouri/Kansas, metropolitan area, which cast 22 percent of the statewide vote, and Wichita's Sedgwick County, which cast 16 percent.

Brownback won re-election by carrying solid margins in just about every rural county. Trump did much better, winning statewide 56-36 compared to 51-44 for Brownback two years before.

But there's an interesting divergence between the vote in Wichita and that in the district's other counties. Brownback carried Sedgwick County 49 to 47 percent and the other counties in the district 54 to 38 percent. Trump carried Sedgwick County 54 to 36 percent and the other counties 69 to 24 percent — an improvement in both, but a big improvement in the smaller counties.

Estes lost Sedgwick County 48 to 50 percent, a marginal drop from Brownback and an notable improvement for Democrat Thomspon over Hillary Clinton. Estes carried the smaller counties by 62 to 36 percent, a big improvement over Brownback though a drop from Trump.

In special elections, candidates of the president's party tend to do worse than the president had; the opposition candidate is better positioned to adapt to local terrain and to rally enthusiasm of those critical of the president who may not want the opposition party to have a majority (which it can't gain in a single special election) but want to give it a bit of a jolt.

The narrowness of Estes' victory is in line with this tendency. But the fact that Estes ran only very marginally behind the controversially unpopular Brownback in Sedgwick County, and far ahead of him in the smaller counties where Trump also ran far ahead of traditional Republicans, suggests to me that the Trump strength in rural America remains strong.

And remember: he won the 2016 election only because he ran significantly ahead of previous Republicans in the non-major-metropolitan areas of Pennsylvania, Ohio, Michigan, Wisconsin, Iowa and Maine's 2nd Congressional District, and thereby won 71 electoral votes that had previously gone twice for Barack Obama.

The Democrats have dented Trump's appeal, but they haven't spiked it.