Republican officials described their efforts as precautionary, a nod toward the party’s humiliating special election losses in Alabama and Pennsylvania and an acknowledgment that they must fortify their defenses in even the reddest of districts.

The Phoenix-area seat for the Eighth Congressional District, a haven for sunshine-seeking retirees from the Midwest, is so reliably Republican that Democrats did not even field a candidate in the last two elections.

But after the previous representative, Trent Franks, resigned following revelations he had offered $5 million to an aide in exchange for carrying his child, Arizona Democrats rallied to Ms. Tipirneni. She outraised Ms. Lesko in what was the first high-profile congressional election since 2016 between two women.

National Democrats, however, stayed away from the race, deducing that a district that has sent only Republicans to Congress for four decades was out of reach. And any hopes Ms. Tipirneni had to win outside support may have faded this month when a local TV station reported that she had not practiced medicine since 2007 and had settled a malpractice lawsuit with a woman who blamed her for contracting tetanus.