Across the country, citizens were ordered to hunker in their homes to avoid catching a deadly virus, even as some people thought it was nothing worse than a seasonal cold. In the midst of fear and sickness, politicians had to decide how to hold scheduled elections, and the global pandemic was subject to political spin.

The year was 1918, when a deadly flu outbreak gripped the nation, infecting about a third of the world’s population and killing 675,000 in the United States alone.

That crisis, known as the Spanish flu, took place in a completely different time technologically and politically. But the reaction then, where local governments took charge and made decisions on how to proceed with voting, offers some guidance for the situation today as the pandemic arrives in a federal election year.

In the 1918 election — midterm contests, in which President Woodrow Wilson’s Democratic Party was fighting to keep control of Congress — keeping polling places open was a patchwork of decisions by local officials.

“Everything became this kind of wheeler-dealer hustle,” said Kristin Watkins, an expert in pandemics and director of grants at Pikes Peak Community College in Colorado Springs whose studies involved reviewing 1918 elections.

Throughout the nation’s history, wars, natural disasters and even terrorist attacks have disrupted campaigns. This crisis seems different. The enemy is invisible and comes as the country is politically divided, with splits that are starting to seep into government’s — and individuals’ — responses.

Congress has come together to support bipartisan relief measures. But President Donald Trump’s labeling of the virus as the “Chinese virus” has prompted accusations from Democrats that he is trying to pin the blame for the outbreak on a rival power he has tangled with on trade and other issues, in addition to cries that the label is racist.

Scholars and pollsters are talking about whether Democrats are washing their hands more than Republicans. And whether to stay home is being viewed in ideological terms.

“We’re in a little bit of an unprecedented place,” said Nancy Martorano Miller, associate professor of political science at the University of Dayton in Ohio, where the Democratic primary was postponed at the last minute this week. “The situation is also moving very fast.”

Recently, Ohio’s governor and top state health officials ignored a court ruling and postponed the state’s primary by declaring a public health emergency. At least five states have delayed primaries, and Wisconsin, Pennsylvania and others are in heated discussions about whether to do so. Many states’ primaries are scheduled for later this spring, around the time when experts think novel coronavirus cases could peak in the United States.

There’s also the matter of political conventions, the events that bring together thousands of party members for days of unity, rallying and carousing to be capped off with iconic images of balloons dropping on giddy delegates. Party officials are scrambling to come up with backup plans in case the nominating conventions can’t go on as normal.

Dozens of political scientists from universities across the nation signed a letter imploring government officials to use the next eight months to ensure that polling in November goes smoothly by doing things like expanding early voting and offering a universal vote-by-mail option.

Americans have faced major challenges during elections in the past. Voting has taken place during wartime and in the aftermath of hurricanes. This year a tornado struck parts of Tennessee on the morning of its primary. Polls were allowed to stay open longer than normal. Sept. 11, 2001, the day of the World Trade Center and Pentagon attacks, was also primary day in New York. Voting was postponed two weeks.

In 1918, midterm elections played out not only during a flu pandemic but during World War I, adding extra heft to decisions that voters would make at the polls. Some incumbents were criticized for leaving Washington to campaign when important decisions were being made, so they communicated with voters remotely, by writing letters and issuing news releases.

Watkins said she is struck by similarities between the 1918 outbreak and the current one. The shutdowns of businesses and gatherings. And the way some government officials have warned people not to underestimate the power of the virus. In 1918, they produced ads that featured Uncle Sam, saying, “Coughs and sneezes spread diseases, as dangerous as poison gas shells.”

In her research, Watkins pored over old newspaper stories to study how various communities dealt with the pandemic during 1918 midterms in Nebraska, where she worked at the University of Nebraska Medical Center, which received some of the first coronavirus cases from a cruise ship and also treated Ebola patients after a West African outbreak.

In Wayne, Neb., a small community with an opera house and a teachers college back then, local newspapers were filled with obituaries. A sick ward was set up at the school to handle 63 flu patients and students and kitchen staff pitched in to help. Unfounded cures involving repeated deep breathing circulated. Doctors and nurses reported being overworked. Movie houses closed their doors and the state prohibited public gatherings.

Watkins has written and starred in one-woman plays about Typhoid Mary and the stigmatization of people placed in quarantine, performing them for public health workers to help them understand “how we judge and how we point fingers,” she said.

In early November 1918, the statewide ban on public gatherings was lifted and politicians were allowed to campaign for five days before polls were opened. Men filed in to cast ballots for a Senate seat (women did not yet have the right to vote) which the incumbent Republican senator was able to hold onto.

Afterward, infections and deaths climbed, said Watkins.

“The disease appeared to be reaching a significant amount of the population, greater than ever before; and the timing coincides with the lifting of the quarantine,” Watkins wrote in her dissertation, noting that “the political machine disregarded the health and safety of its citizens.”

That year, turnout across the nation was very low for the midterms, said Julian E. Zelizer, a presidential historian at Princeton University.

That result — low turnout, voters getting fatally ill — is the worst outcome for any election. To avoid such an outcome this year, many political scientists and researchers are calling for more early and absentee voting as well as the loosening of restrictions on showing identification in person.

“Our main concern needs to be doing everything possible to increase voting participation and eliminating barriers, especially given the heath situation,” said Zelizer.

But when he thinks about 1918, the fact that elections were held at all, he said, should offer optimism for the future.

“There have been moments like this but overall it’s not as if the system is suspended,” he said. “We have a pretty strong commitment to moving through.”