The Virginia Board of Elections on Tuesday voted to scrap a type of voting machine used by dozens of local governments, including Fairfax City and Arlington County, after identifying security concerns.

The move leaves 30 counties and cities scrambling to replace hundreds of voting machines. Ten of those local governments have primary elections scheduled for June 9.

During a public meeting, the Board of Elections voted 2 to 0, with one member absent, to decertify WINVote touchscreen voting machines.

Edgardo Cortés, commissioner of the state Department of Elections, said continuing to use the aging machines “creates an unacceptable risk to the integrity of the election process in the commonwealth.”

He said he recognized the decision’s far-reaching repercussions, and he said the agency would help election officials figure out what to do.

The timing of the decision is particularly troublesome for local governments that had not budgeted money to replace their machines and now have little time to train staff members and election volunteers to use new equipment. Some are considering borrowing machines from neighboring jurisdictions.

However, Arlington, which had planned to replace its 309 WINVote machines with optical scanners in time for the 2016 presidential race, expedited the process and aims to be ready for its June primary. General Registrar Linda Lindberg said the first-year cost is about $700,000.

“It’ll be a challenge but I think we’re up to it,” Lindberg said. “My staff is upbeat about it. We’re going to do everything we can to make a smooth transition for Arlington voters.”

The voting machines flap was prompted by complaints from voters around the state, especially in Virginia Beach, who had trouble casting ballots in November.

Gov. Terry McAuliffe (D), who has said he grappled with a malfunctioning machine at a Richmond precinct, called for an investigation into machine irregularities.

A federally accredited lab, Pro V&V, and the Virginia Information Technology Agency (VITA) found that the WINVote machines, which use a wireless Internet connection to tally votes, are prone to crashing and are thought to be vulnerable to cyberattack, according to a report released this month. Virginia is the only state where this model of machine is used.

VITA also concluded that because the machines “use insecure security protocols, weak passwords and unpatched software,” they “operate with a high level of risk” and “can allow a malicious party to compromise confidentiality and integrity of voting data.”

Officials were first alerted to WINVote problems when machines malfunctioned in Spotsylvania County. Election officials suspected that the problems might be related to a poll worker’s streaming music over a cellphone during the election.

Attempts to reach Advanced Voting Solutions — the maker of the WINVote machines — were unsuccessful.

About a dozen registrars and advocates testified during Tuesday’s meeting. The Board of Elections, whose members are appointed by the governor, met behind closed doors for an hour to hear testimony about the machines’ vulnerability to attack.

The Virginia Municipal League and Virginia Association of Counties expressed concerns about the decertification process and urged the board not to make a hasty decision.

Richard Herrington, secretary of the Fairfax City Electoral Board, said he was unconvinced that WINVote machines were risky enough to warrant decertification.

“No matter how much time, money and effort we could put into a device or a system to make it as secure as possible, there is always the possibility that someone else would put in the time, money and effort to exploit that system,” he said.

The state General Assembly banned local governments in 2007 from buying touch-screen machines but provided no funding or deadline for replacing the equipment.

ProgressVA and New Virginia Majority, two voting-rights groups, encouraged the state election board to decertify the voting machines.

“While these machines may have once been state-of-the-art, as technology has advanced they have become outdated and are no longer secure. It would be the height of irresponsibility to wait for a catastrophe to occur before taking action,” said Anna Scholl, executive director of ProgressVA, a progressive advocacy group.

The McAuliffe administration is eager to resolve the problems in time for the November election, when all General Assembly seats will be on the ballot, as well as before the 2016 presidential contest.

The governor recently proposed borrowing $28 million to replace machines across the state, but the item was stricken from the state budget by a Republican-controlled legislature that was uneasy about taking on the additional debt and about dictating what machines localities use in elections.

Several Northern Virginia jurisdictions, including Fairfax, Loudoun and Prince William counties, do not use the WINVote machines.

Perry Stein contributed to this report.