Could a state, to protect the health of its residents, close its borders to people from other states?

It seems unlikely, but legal scholars have reached different conclusions.

In 1937, as many migrants from poverty-stricken Dust Bowl states headed west, California passed the so-called “Okie law” making it a crime to bring an indigent person into the state. Three years later, the Supreme Court unanimously declared the law unconstitutional, with the majority citing Congress’ exclusive authority to regulate interstate commerce.

The Constitution prohibits states from “chaining people to that part of the land where accident of birth has first placed them,” Justice James Byrnes said in the lead opinion.

“I think that would keep the state from closing its borders unless a court found that this was necessary to achieve the compelling interest of protecting public health,” said Erwin Chemerinsky, the law school dean at UC Berkeley.

Rory Little a constitutional law professor at UC Hastings in San Francisco, said the courts would probably allow a state to deny entry to anyone who had tested positive for the disease. He also said courts have not questioned Hawaii’s longstanding ban on bringing in many common types of fruits and vegetables produced elsewhere.

But Little said the courts have largely prevented states from denying or limiting rights of out-of-staters without a compelling reason. He noted the Supreme Court’s 8-1 ruling in 1985 that required New Hampshire to allow a Vermont resident to practice law after she had passed the New Hampshire bar exam.

That ruling relied on a constitutional provision that says the “citizens of each state shall be entitled to all privileges and immunities of citizens in the several states.”

However, Marjorie Cohn, a former professor at Thomas Jefferson School of Law in San Diego and former president of the National Lawyers Guild, said courts might give states broader authority over their borders during a public health crisis

She cited a 1965 Supreme Court ruling that upheld the U.S. government’s refusal to let Americans travel to Cuba. Writing for a 6-3 majority, Chief Justice Earl Warren said the right to travel was not absolute, even between states, and did not mean that “areas ravaged by flood, fire or pestilence cannot be quarantined when it can be demonstrated that unlimited travel to the area would directly and materially interfere with the safety and welfare of the area or the nation.”

Cohn commented, “Although it would not necessarily be wise or effective for states to close their borders, courts would likely uphold such restrictions during the COVID-19 pandemic.”

The American Bar Association weighed in Monday on a related issue, whether the federal government could impose a quarantine that closed a state’s borders — a closure President Donald Trump briefly proposed for virus-stricken New York state before backing off.

“Governors have broad powers to invoke restrictions in their state, while the power of the president is significantly limited by law and Supreme Court precedent,” the ABA said in a “fact check” on its website. A nationally ordered lockdown “would be unprecedented and would likely lead to a court challenge on constitutional grounds.”

But the ABA indicated that Trump acted legally when he closed the nation’s borders. “The federal government has broad authority to quarantine and impose other health measures to prevent the spread of disease from foreign countries,” the lawyers’ association said.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @BobEgelko