A crowd of hundreds of motorcycle enthusiasts, in which the ratio of leather jackets to masks worn was astronomical, gathered Sunday in front of the stage at the Buffalo Chip campground in Sturgis, S.D. The band Smash Mouth was scheduled to perform, a rare concert at a time when many states are discouraging gatherings of 10 or more people, let alone hundreds of thousands.

The 80th Annual Sturgis Motorcycle Rally, at which officials expected a crowd of some 250,000 people, was happening anyway, and Smash Mouth’s lead singer, Steve Harwell, offered his thoughts on bringing people together even as health officials urge them to stay apart.

“We’re being human once again,” he said, before making an expletive-riddled declaration. The crowd cheered.

But as the town of roughly 7,000 prepared to host one of the largest gatherings in the country since the coronavirus pandemic began, state and local health officials could not take the same approach. They could not disregard the impact such a large gathering could have on the spread of the novel coronavirus.

Before the 10-day rally, which started Friday, the South Dakota Department of Health tested all emergency medical service providers in Sturgis and nearby areas for the virus — tests state health officials say came back negative. Plans are already in place to test EMS, law enforcement and fire department personnel statewide starting two weeks after the rally ends.

“One of the things we’ve been very transparent about is any time you’re bringing people together — especially if you’re bringing individuals together from areas that might have higher risk of covid-19 in their general communities — that does pose a risk for covid-19 transmission,” state epidemiologist Joshua Clayton said in a news conference last week.

“If you’re going to a backyard picnic with three people as opposed to 300, that’s a magnitude of difference in terms of what you might be taking on as an individual risk. When that backyard picnic ends up being 300,000 people at a certain motorcycle rally, there’s still that decision-making that needs to take place.”

Still, the difference between a three-person picnic and a 300,000-person rally is significant for health departments tracking possible outbreaks. The bigger the event, the more difficult contact tracing can be if cases emerge.

Officials said South Dakota residents will be traced by the state health agency, but cases from out-of-state attendees will be handled by those states. So an outbreak resulting from the Sturgis event would not necessarily show up in South Dakota data.

“We will be able to provide information about any South Dakota cases that rise to the level of a cluster,” state health secretary Kim Malsam-Rysdon said.

She and Clayton said a system exists so that other states identifying cases linked to the motorcycle rally can contact South Dakota for help in identifying people who might have been exposed.

Malsam-Rysdon said the state has deployed Abbott rapid-testing machines and provided 5,000 tests to providers in the area to increase their ability to handle more samples.

Monument Health, the major health-care system in the region, said extra staff is always summoned ahead of the Sturgis rally. This year, Monument’s facilities are offering increased access to coronavirus testing, and 172 beds have been added to an unused corner of the Rapid City hospital for potential patients with covid-19, the disease caused by the novel coronavirus. So far, Monument’s emergency rooms are recording patient volume comparable to previous rallies, according to spokesman Dan Daly.

The city of Sturgis has taken steps to deal with the rally’s impact, city spokeswoman Christina Steele said. City employees will undergo mandatory coronavirus testing, and any residents or local business employees who want testing will have access to drive-through sites paid for by the city.

Steele said the city has expanded nightly street cleaning, asked local businesses to comply with Centers for Disease Control and Prevention guidelines on social distancing and canceled other downtown events to try to limit the number of people crowded into small areas. The Smash Mouth concert took place at the Buffalo Chip campground, where visitors congregate for the rally each year, which sits on roughly 600 acres.

Communities near Sturgis also braced for the gathering’s impact.

Rapid City, the state’s second-most populated city, is just 30 miles from Sturgis on Interstate 90. Laura Armstrong, president of the city council there, told CNN that holding the rally so close to other state fairs and the start of school constituted “a sequence of insanity.”

“They’re not going to be able to handle any kind of social distancing. . . . It’s a huge party,” said Armstrong, who declined to comment for this story.

Native American tribal leaders are also concerned. The Cheyenne River Sioux, whose reservation lies a couple of hours west of Sturgis, instituted checkpoints in April to question travelers and determine whether they might have been exposed to the virus. The tribe sued the federal government to keep tribal checkpoints on state and U.S. highways after federal authorities and Gov. Kristi L. Noem (R) said they were illegal.

Cheyenne River Sioux officials have continued to operate the checkpoints as bikers rolled in for the rally and are turning away those who don’t live on the reservation.

Native Americans have been disproportionately affected by the coronavirus, including in South Dakota, where they make up 15 percent of the state’s total cases. Native Americans make up 9 percent of the state’s population. There have been 81 cases on the reservation so far, according to the tribe’s covid-19 website.

Like everything from school re-openings to college football, the rally is emerging as a barometer of political polarization around the coronavirus.

As tribal leaders isolate their citizens and as local leaders worry about potential coronavirus cases, revelers at the motorcycle rally buy T-shirts memorializing their willingness to disregard the threat of covid-19, cheering along with those willing to do the same.