McKillop, a 72-year-old nurse, loves that Perry is a pediatrician, and regards her as exactly the kind of person she wants to send to Washington: a strong conservative who opposes abortion and will deal with what McKillop describes as “all these Mexicans” by building a wall and securing the border. But there’s something else on her mind, she tells Perry, leaning in slightly and lowering her voice as if sharing a secret with a girlfriend.

“I sort of like that you’re a woman; is that a little prejudiced?” McKillop said last week with a giggle.

Perry is in the final stretch of a campaign in this sprawling eastern North Carolina district that has become something of a test case for her party, with substantial implications across the country. As Republicans work to recruit and cultivate a new crop of female candidates — a critical ingredient, leaders and strategists say, to rebuilding after a disastrous midterm election — Perry’s fate will go a long way toward demonstrating whether the party can unite behind a woman.

On Tuesday, Perry, 61, faces Dr. Greg Murphy, 56, a state representative and urological surgeon, in a Republican primary runoff for the chance to run in a special election this fall to succeed Rep. Walter B. Jones, who died in February. Murphy won a 17-way Republican primary in late April, prompting the two-way runoff with Perry, who came in second.

The contest has sparked a kind of battle of the sexes at the highest levels of the Republican Party, pitting two of the party’s most conservative men, who are among President Donald Trump’s closest allies in Congress, against all 13 Republican women in the House.

Rep. Mark Meadows of North Carolina, the chairman of the ultraconservative House Freedom Caucus, and Rep. Jim Jordan of Ohio, a founder of the group, endorsed Murphy after he promised to join their caucus if elected. Rep. Liz Cheney of Wyoming, the chairwoman of the Republican Conference, is backing Perry, who also has support from Sen. Joni Ernst of Iowa and the former Alaska governor Sarah Palin.

The fight has attracted national interest, and with it, more than $1.5 million in outside spending. In recent days, fiercely negative ads have saturated the airwaves, transforming the contest into the ugliest in recent memory for many in this mostly rural and deeply conservative area.

It is the inaugural effort by WFW Action Fund, the political arm of a group called Winning for Women that is the first of its kind dedicated solely to electing Republican women, to sway a primary election. WFW Action has poured nearly $900,000 into the race, much of it going to advertisements attacking Murphy as a liberal out of step with Trump. In recent days, the group has also funded robocalls by Newt Gingrich, the former House speaker, and Palin, in which they call Perry the real conservative in the race and urge people to vote for her.

“This is the first real opportunity after the midterms for Republicans to prove how serious they are about electing women,” said Olivia Perez-Cubas, a spokeswoman for WFW Action Fund. “We are hoping this race sets the tone for lots more women to come.”

Not if the party’s prominent conservative men have anything to say about it. House Freedom Action, the political arm of the Freedom Caucus, which has reported spending about $240,000 in the race, has answered by portraying Perry as a closet progressive. One TV spot calls her “another lying Nancy Pelosi liberal.” Another political action group, Awake Carolina, which has spent more than $150,000, has circulated a mailer showing Perry superimposed on the tattooed face of a member of the brutal transnational gang MS-13.

Murphy, a three-term state legislator who has deep ties within the North Carolina Republican establishment, is running as a political outsider. The “swamp,” he says, is targeting him because of his association with Meadows. He declined through an aide to be interviewed; he was, said Doug Raymond, his campaign manager, “chasing votes, not headlines.”

Perry, a triathlete who has never run for political office, said she was moved to mount her first bid after New York passed the Reproductive Health Act. The measure expanded abortion rights, allowing the procedure after 24 weeks to protect the mother’s health or if the fetus was not viable.

“I really felt strongly that, as there are remarkable Democratic women voices speaking out on this, that there needs to be a strong conservative female voice with medical expertise speaking to this issue,” Perry said in an interview here last week, as an air-conditioned white minivan ferried her from house to house to knock on doors. At her feet were her campaign must-haves: an ivory canvas bag containing door cards, stickers, a glass bottle filled with iced green tea, pistachios and other snacks, and a book of daily Scripture readings.

Rep. Elise Stefanik of New York, who has dedicated her political fundraising operation to supporting Republican women in their primaries, said the race reflected an important shift.

“What it does show is, other women who are stepping forward, and we have dozens of them, it shows that there’s going to be support financially,” Stefanik said. “We haven’t necessarily seen that in past cycles.”

It has also highlighted the stereotypes confronting Republican women, who are often perceived by voters and caricatured by their opponents as more moderate or liberal-leaning, simply by nature of their gender.

“To pigeonhole female Republicans into a certain ideological mold is wrong, and it’s sexist, and I think the Freedom Caucus is walking that line here,” Stefanik said. “This is an opportunity for voters to send a strong, conservative woman to the House.”

Raymond said the involvement of outside groups whose agenda is electing more Republican women has been a “polarizing factor” in the race, and cast doubt on Perry’s political leanings.

“A lot of women from across the political spectrum have come in to support her because they have their common goal,” Raymond said, naming Stefanik, who is more politically moderate. “Greg’s talked about how he thinks it would be great to have more women in Congress, but we don’t believe in playing identity politics. You want to vote for the person who best represents the district.”

Things have gotten testy between the two doctors. They sparred over who was the heir apparent to Jones, who served for 12 terms, with Murphy insisting he had the congressman’s endorsement until his widow, Joe Anne Jones, held a news conference saying she backed Perry.

And Murphy has not tried to hide his fury at the negative advertising from groups supporting his opponent, especially one spot that took him out of context to suggest that he had once called the president “the worst top of the ticket in our history.” He threatened to sue.

“He acted like a little baby,” said Perry, who said she disagreed with the ad. “My oldest son said, ‘Mom, you’ve got to put out a commercial asking Greg if you need to be his lawn mower mother — rather than helicopter mother — parting the way to take care of him.’”

Perry, a mother of five adult sons and grandmother of 10, is no stranger to crashing old boys’ clubs. She was in the first class of scholars that included women to win the Morehead scholarship, a prestigious program created by a founder of Union Carbide.

She dreamed of becoming an ear, nose and throat surgeon — “I didn’t want to be a pediatrician or an O.B., because that’s what women did, and I didn’t want to be like a typical woman,” she said. But she jettisoned the idea when she became pregnant during her first year of medical school and realized that there were no women in surgical specialties. (Besides, the men dominating the field were “crass” and “disgusting,” she said, sexually harassing her and her female peers to the point where “we could have sued the pants off all these surgeons.”)

At Merchant’s Grocery, a cheeseburger-and-fries joint on the outskirts of town, Perry chatted up the all-male lunchtime crowd. The subject of the lopsided demographic breakdown in the House came up — of the women, 89 are Democrats and only 13 are Republican — and one male attendee noted that female lawmakers always seemed to make the most noise.

Tommy Jones, 68, a retired restaurant owner, said he voted for Murphy in the primary but was considering backing Perry on Tuesday.

“We want somebody who will support constitutional principles, and support the president, and I think she probably would do that, too,” Jones said. “The only thing is that women, as you well know, sometimes get to be kind of emotional. I’d have to think about that.”

This article originally appeared in The New York Times.