Republican presidential candidate Donald Trump speaks at a rally in front of the USS Wisconsin on Oct. 31 in Norfolk. (Sara D. Davis/Getty Images)

With a few tweets, Donald Trump has managed to reignite infighting within the Virginia GOP, sending party leaders scrambling to defend a plan that requires voters to sign a pledge affirming they are Republicans.

The front-runner for the GOP presidential nomination and the state party are at odds over an issue that has long divided Republicans in Virginia, where voters do not register by party. Before they cast a 2016 primary ballot, Republicans will have to sign a nine-word statement that reads, “My signature below indicates that I am a Republican.”

Supporters of the pledge, which they call a “statement of affirmation,” say it is designed to prevent Democrats and wishy-washy Republicans from choosing the party’s nominee. Opponents say the party has no place excluding voters from a ­taxpayer-funded process and should focus instead on broadening their base.

The differing opinions have kept the pledge off the ballot since 2000.

But party leaders decided to reinstate it for the March primary, even as Republicans are trying to recover from other internal squabbles and the loss of all statewide offices in recent elections.

Republican presidential candidate Donald Trump talks with attendees at a rally in front of the USS Wisconsin on Oct. 31 in Norfolk. (Sara D. Davis/Getty Images)

At a September meeting, 44 of 74 members of the party’s State Central Committee decided to have voters sign the pledge, according to meeting minutes. The state Board of Elections made it official this month.

All was relatively quiet until Sunday when Trump launched a five-tweet screed against the Virginia party, saying it “is working hard to disallow independent, unaffiliated and new voters.” He called the pledge a “suicidal move” and referred to Republican losses in elections for statewide offices in Virginia.

Corey A. Stewart, Trump’s Virginia campaign chairman and the chairman of the Prince William Board of County Supervisors, escalated the attack a few days later.

“It’s clearly an attempt to scare off and confuse new Republican voters,” Stewart said in an interview.

“Trump is exciting a lot of people, and a lot of people are interested in participating in the Republican Party,” Stewart said. “And that’s a threat to establishment Republicans.”

He went on to blame the “very top echelons” of the Republican National Committee for the Virginia pledge.

RNC rules say that only Republicans should be allowed to vote in the party’s primaries but leave it up to state parties to decide how to accomplish that.

In response to Trump’s criticism, the executive director of the Virginia GOP sent activists a list of talking points intended to refute allegations that the pledge targets voters who are most likely to support Trump’s un­or­tho­dox campaign.

“For reasons unknown to our Party at this time, Donald Trump has decided that this [is] an attack against his campaign,” John Findlay said in the email. “Let me be very clear, the statement of affiliation is not designed to favor or hurt any candidate whatsoever.”

In the past, it was Virginia’s Republican establishment that was uncomfortable with the pledge. Party activists who were more conservative tended to be for it, including a group of hard-core Republicans who call themselves the Conservative Fellowship and who won control of the state party’s governing board a few years ago.

Since that board decided to bring back the pledge, however, some Virginia conservatives have reached the same conclusion as Trump: that the pledge is a bad idea.

Russ Moulton, an influential activist, said he used to favor loyalty pledges but has “come to believe with deeper understanding they are a mistake.”

“Establishment Republicans have recently hurt our brand-idea so badly, we have many in our base disgusted with ‘Republicans,’ ” Moulton said in a statement urging the party to abandon the plan.

He noted that if the party wanted to ensure only Republicans pick the party nominee, the governing body should have chosen a convention, a day-long gathering that tends to attract only the most committed activists and leaves no doubt as to their party affiliation.

But by a narrow vote, the governing board chose a primary for 2016.