The National Guard, already facing one of its busiest years, is prepping for election-related missions that include cybersecurity for local electoral authorities, ballot counting in at least one state and backup for police or if unrest erupts after the vote.

The preparations come as the United States heads into one of its most contentious presidential elections, which is taking place in the middle of a global pandemic and amid persistent suggestions by President Trump that he may dispute the results if he loses. Parts of the country have also been experiencing racial justice protests and environmental threats ranging from wildfires to hurricanes, which have further stretched a Guard already on the front lines responding to the pandemic.

The Guard’s domestic deployments this year under state authorities reached a peak of 86,367 forces in June, according to a spokeswoman for the National Guard, far larger than the approximately 50,000 guardsmen who deployed domestically to respond to Hurricane Katrina in 2005. There are about 450,000 members of the National Guard across the country.

For the election, some Guard units are preparing to deploy under “state active duty” status, meaning they will answer to the governor of their states and use state funds. Some units could deploy outside their states after the election if a governor requests help handling post-election unrest.

Federal law prohibits the deployment of armed troops to polling places during elections, but National Guard units can do certain missions on Election Day if they are deployed by governors using state funds, which means they would also be unarmed, according to Guard officials. During primaries earlier this year, for example, some states used their Guard units, in civilian attire, to help local election authorities struggling with a shortage of volunteers at the polls because of the pandemic.

The election also comes at a sensitive moment for the U.S. military, which has struggled to steer clear of the nation’s divisive politics. The chairman of the Joint Chiefs of Staff, Gen. Mark A. Milley, emphasized in a recent interview with NPR that a disputed election would be handled “appropriately” by the U.S. courts and Congress and said that there would be “no role for the military in determining the outcome of a U.S. election. Zero.”

But governors could request Guard units from their own states and others to aid local law enforcement.

After the election, if faced with unrest, Trump theoretically could federalize the Guard and deploy them under the Insurrection Act. Because the District of Columbia Guard is controlled by the president, he could also ask states to contribute their forces to the D.C. Guard and create a domestic military force answering to him in the nation’s capital. Trump did so in June, in response to protests over the police killing of George Floyd, bringing in Guard units from 11 states to back up the D.C. Guard and amassing active-duty troops outside the capital.

Nationwide, the National Guard has designated contingency response units — one in Alabama and the other in Arizona — that are on alert to deploy rapidly to augment forces in other states. The Guard said it had created the units as governors across the country continued to request support for law enforcement in efforts to control civil unrest this year.

Lt. Col. Timothy Alexander, a spokesman for the Alabama National Guard, said the response team is “comprised of military police units that are specially trained to support law enforcement.”

Their duties will depend on the situation, he said, but “may include point and area security, manning traffic control points, directing foot traffic, providing security and escort for emergency personnel and equipment, and transporting law enforcement personnel.”

The response team for the western part of the United States is composed of units from Arizona, while units from Alabama are on alert for the eastern half of the country.

On the state level, the Guard is also preparing to ensure it can assist governors if deployed locally to help law enforcement.

“It has been an interesting year, and these are interesting times, and we certainly are planning for the just-in-case scenario for the possibility of civil disturbances up to, during or after the election,” said Col. Kenneth A. Borchers, commander of the 194th Wing of the Washington Air National Guard. “We have to; it would be imprudent not to.”

Borchers’s special warfare, cyber and intelligence wing assisted local law enforcement in Seattle and elsewhere in the state when civil unrest erupted after Floyd’s killing. The unit, based south of Seattle, includes guardsmen from big tech companies who focus on intelligence and cyber operations. But Borchers said the unit rose to the challenge after receiving special training.

His unit and others have had one of the busiest years on record.

“We deployed for food bank support for covid, contact tracing missions, unemployment validation, testing sites. We deployed in response to civil disturbances in several metropolitan areas, and we also deployed to fight fires a few weeks ago,” Borchers said. “It has been a heck of a 2020 for everybody.”

Governors across the nation activated thousands of National Guard members to help control unrest that followed Floyd’s killing in May — deployments that came in parallel with duties the Guard was undertaking to help combat the coronavirus.

The chairman of the U.S. Election Assistance Commission, Benjamin Hovland, said election officials across the country are facing unprecedented challenges because of the pandemic.

“The National Guard has proved to be a great resource and a way to help a lot of election officials fill some of the gaps that they may have,” Hovland said, noting that guardsmen also have provided an “extra layer of support” on cybersecurity in many states.

New Jersey mobilized 150 of its guardsmen during the state’s July primary to help county election authorities staff polling places, transport ballot bins and count provisional and mail-in votes. The guardsmen wore civilian clothing.

Lt. Col. Barbara G. Brown, a spokeswoman for the New Jersey Army National Guard, said 250 members of the state’s Army and Air Guard would be supporting counties on Nov. 3, mostly at the county level processing ballots rather than at polling places. She said that for the primary, each county requested how many additional personnel it needed through the New Jersey secretary of state’s office. Then the local officials were in charge of giving the guardsmen orders.

Brown said the state expected a far larger number of mail-in ballots, so the guardsmen have stepped in to help. The Guardsmen will again be wearing civilian attire because of the unique nature of the mission, she said.

“You don’t want the perception that the National Guard is influencing any voter process or ballot process,” Brown said. “We are just simply there to offset the staffing needs because of the increase in volume of ballots.”

Other states, such as Wisconsin, Kentucky and Nebraska, deployed Guard units in civilian attire during the primaries and are considering doing the same next month.

Reid Magney, a spokesman for the Wisconsin Elections Commission, said the state is asking clerks to recruit their own poll workers, so guardsmen are used only as an emergency backstop.

“The Guard has other critical missions during the pandemic, so we don’t want to tax their resources,” Magney said.

Some states have decided guardsmen shouldn’t handle ballots and have them help only with other tasks involved in organizing the vote.

In Kentucky, for example, the state deployed about 240 members of its Guard in civilian attire to support approximately 25 counties during the primary in June, according to Maj. Stephen Martin, a spokesman for the Kentucky Guard, who said the guardsmen didn’t count ballots or check registrations at polls.

“We assisted poll workers by cleaning, directing traffic and helping with other mundane tasks,” Martin said. “We didn’t have anything to do with handling ballots and determining who could vote in the primaries.”

Martin said counties in Kentucky have been asked what assistance they expect to need for the vote but that, again, the Kentucky Guard wouldn’t be counting ballots.

Guard units across the nation are also preparing to help local electoral authorities with cybersecurity on Election Day, a mission that has gained emphasis since the 2016 presidential election demonstrated the risks of foreign interference and hacking.

In North Carolina, for instance, about 40 cybersecurity guardsmen will be on duty during the election, and like in many other states, the Guard has conducted dozens of assessments of local elections’ IT infrastructure, said Lt. Col. Matt DeVivo, a spokesman for the North Carolina Guard.