Debbie Lesko, right, celebrates her win with former Arizona governor Jan Brewer on April 24, 2018. (Matt York/AP)

Republicans’ narrow win in a conservative Arizona district is prompting nervous House leaders to warn incumbents to not get complacent and to brace for the worst in November’s midterm elections.

House Majority Leader Kevin McCarthy (R-Calif.) told rank-and-file members in a closed-door meeting Wednesday morning that Debbie Lesko’s single-digit victory in Arizona’s 8th Congressional District was a fresh sign of mobilized Democrats putting even the most reliable GOP congressional districts in jeopardy.

“He said, ‘You need to understand what’s happening,’ ” said Rep. Paul A. Gosar (R-Ariz.), whose district borders Lesko’s. “They’ve got money. They’ve got good candidates. They can speak well about issues. And they’re engaged.”

Lesko on Tuesday prevailed by five points over Hiral Tipirneni, a physician and first-time Democratic candidate. Lesko will succeed Republican Trent Franks, who resigned last year amid allegations that he offered a staffer $5 million to bear his child as a surrogate. President Trump won the district by 21 percentage points in 2016, but wary Republicans spent more than $1 million to keep the seat, hitting voters with robo-calls from Trump, digital ads and get-out-the-vote canvasses.

This year, the GOP faces fierce political head winds, the drag of an unpopular president and the retirement of its House leader, Speaker Paul D. Ryan (R-Wis.). The win in Arizona broke a string of losses for the GOP in special elections in Alabama and Pennsylvania and in state legislative and judicial races in Florida and Wisconsin.

But House Republicans were more concerned with the close result than with cheering the victory. They suggested that their base had become somewhat complacent as Democratic voters’ enthusiasm surged. More people took part in Tuesday’s special election than in the 2014 midterm election.

The GOP got more unwelcome news Wednesday when a sought-after candidate in Connecticut’s 5th Congressional District said that he would not run.

Rep. Mark Meadows (R-N.C.), the leader of the House Freedom Caucus, said the Arizona result showed Republicans needed “to get something done.”

“Obviously, we see the Democrat base very energized,” he said. “Probably 70 percent of Hillary Clinton voters turned out, and 50 percent of Trump voters turned out.”

Several Republicans argued that the party should respond by doubling down on a conservative agenda, either by extending tax cuts or clawing back spending that was passed in the omnibus funding bill.

“The omnibus hurt enthusiasm considerably,” said Rep. Thomas Massie (R-Ky.). “We should have named it the GOP Voter Suppression Act.”

Rep. Ryan Costello (R-Pa.), who is retiring this year and has warned fellow suburban Republicans of a coming Democratic wave, said that a vote to cut back the omnibus would do nothing for the midterm campaign. The campaign, he said, should be about the president.

“What gets the base to the polls is, ‘If you vote for my opponent, he’ll impeach Trump,’ ” Costello said.

In Arizona, as in Pennsylvania, Republicans did not spend the final weeks of the campaign talking about tax cuts. They also did little to tarnish Tipirneni’s image with voters — a cautious strategy unlikely to be repeated in the midterm elections.

Arizona Democrats said the result buoyed them as they looked to November and a key Senate race to replace the retiring Sen. Jeff Flake (R). Polling last week found Democratic Rep. Kyrsten Sinema with a lead over any potential Republican challenger for Flake’s Senate seat.

“Talking about positive solutions, rather than just talking about Trump is a winner,” said Steve Farley, a Democratic state senator running for governor. “If we see this kind of a swing in November, then I think Democrats stand to take every office on the ballot.”

A smaller swing, across the country, would give Democrats control of the House of Representatives. According to David Wasserman, the House editor for the Cook Political Report, 147 Republican-held House seats are less slanted toward the GOP than Arizona’s 8th Congressional District.

Republicans will defend two more House seats in special elections before November. On June 30, Texas’s 27th District will elect a successor to Blake Farenthold, who resigned after a sexual harassment scandal; on Aug. 7, Ohio’s 12th District will replace Patrick J. Tiberi, who resigned early to take over the Ohio Business Roundtable. Trump carried the Ohio seat by 11.3 points and the Texas seat by 23.6 points.

In Arizona, Lesko will serve the rest of Franks’s term, then face Tipirneni in a November rematch. The Democrat, who conceded the race on Wednesday morning, said in a statement that she would build on what happened in the special election.

“Our communities have shown the courage to demand more of Washington and more of our representatives,” Tipirneni said. “Now, on to November.”

Evan Wyloge in Peoria, Ariz., and Mike DeBonis in Washington contributed to this report.