Democratic activists are claiming a moral victory in Kansas despite narrowly losing a special congressional election there Tuesday night.

Democrat James Thompson came within 10 points of Republican Kansas State Treasurer Ron Estes in the state's safely GOP 4th congressional district.

President Trump carried the district by 27 points in November. Rep. Mike Pompeo, who resigned earlier this year to serve as director of the CIA, won it by 31 points.

No Democrat has won this seat since 1992, the year Bill Clinton defeated George H.W. Bush.

Estes, however, is set to prevail by less than 7 points, a warning sign for the House Republican majority less than 100 days into the Trump administration.

Dan Pfieffer, a former senior adviser to President Obama, tweeted that this was the year for any Democrat who wanted to run for office to do so.

Grassroots liberals sent messages all night Tuesday with hashtags like #Resist and #Flipthefourth as Thompson jumped out to an initial lead due to early voting.

They urged Democrats to take this as a sign they should contest every state and congressional election in 2018.

Democrats are angry over the 2016 election results and energized by what they see as the Republicans' missteps this year, hoping to ride the recent historical trend where the party out of power can make big gains in the midterm elections when the president is unpopular.

The only other negative for Democrats aside from Estes actually winning the House seat is the continued finger-pointing between progressives and the party's establishment wing.

This has been a feature of nearly every intraparty fight since Hillary Clinton beat Bernie Sanders for the 2016 Democratic presidential nomination.

Liberals complained that the Democratic National Committee and the DCCC did not get involved in the race.

Other Democrats argued this wasn't the DNC's role and Thompson might have been hurt by the party nationalizing the race in such a conservative district.

One Democratic strategist said the key in special elections in hostile territory is to maintain the element of surprise.

Yet there was last-minute push by a group of high-profile Republicans in support of Estes. Trump and Vice President Pence both recorded robocalls on Estes' behalf, while Sen. Ted Cruz, R-Texas, campaigned with him at a rally on Monday. Cruz won the Kansas Republican caucuses last March.

Trump also sent out a tweet calling on supporters to back Estes in the Tuesday election.

"Ron Estes is running TODAY for Congress in the Great State of Kansas. A wonderful guy, I need his help on Healthcare & Tax Cuts (Reform)," Trump said.

The National Republican Congressional Committee spent $100,000 to boost Estes. House Speaker Paul Ryan also sent out a fundraising email in support of Estes' campaign.

Republicans were confident in the election until private polling was released showing Estes up by just 1 point. This coaxed the national party and conservative groups off the sidelines.

Trump's low approval ratings were an important factor but so were Kansas Gov. Sam Brownback's.

A Morning Consult poll released Tuesday found Brownback, a Republican, is the second least popular governor in the country.

The race is the first in a handful of House special elections in which Democrats are making a serious push.

For example, Democrats are actively contesting next Tuesday's special election in Georgia, where Democrat Jon Ossoff is looking to clear the 50 percent threshold and avoid a runoff against a Republican opponent.

The winner would replace Health and Human Services Secretary Tom Price. The seat, once held by former House Speaker Newt Gingrich, has been Republican for 37 years.

There are five special elections slated through the end of June, including seats once held by budget director Mick Mulvaney in South Carolina and Interior Secretary Ryan Zinke in Montana.