The coronavirus pandemic has spawned the most massive emergency restrictions of citizens’ liberties in the history of the United States. In most places, people are effectively under house arrest—free to leave home only for exercise; essential tasks (like buying groceries); and, for some people, essential work that cannot be performed at home. Citizens cannot hold political assemblies in the public square, organize union drives in common areas at the workplace, attend religious gatherings or operate businesses without government permission.

These events have produced a remarkable scrambling of ideological preferences. The last time the government cracked down on liberties on a large scale—in the wake of 9/11—liberals cried foul and went to the courts. Today, they criticize the president for failing to act more forcefully. Meanwhile, conservatives who might have cheered the security measures put in place to combat terrorism are protesting the lockdown. And they have brought cases in droves—arguing that restrictions in the various states violate constitutional rights to religious practice, freedom of speech, gun possession and protection of property.

The liberal critique of the 9/11 response rested on two premises. The first was that governments typically overreact to foreign threats to appease public fear; crackdowns are theater designed to solace the masses rather than protect them, while various innocents—frequently members of groups associated with the threat—pay the price in the form of surveillance, arrests and deportation. The victims of the 9/11 response were Muslim and Arab Americans and resident aliens. The second premise was that even government actions that could be justified in the short term inevitably boost the “imperial presidency,” creating precedents and new legal powers that a future president can abuse. The role of courts was to prevent injustices in the first case and government expansion in the second.

After 9/11, liberal opposition to counterterrorism tactics drew force from distrust of a Republican president, whose election in 2000 many Democrats regarded as illegitimate. Opposition to counterterrorism tactics thus drew on political as well as ideological factors. President George W. Bush was, to some extent, able to defuse the first part of the liberal narrative by refusing to demonize Muslims and Arabs in his public statements, but the far-reaching claims to presidential power made by his legal team vindicated the “imperial presidency” narrative. However, after the election of Barack Obama in 2008, liberals lost interest in that narrative as well and supported the president as he used his power to advance health care, protect millions of undocumented aliens from removal and even continue Bush’s war on terror. With their man in office, they no longer feared excessive presidential power.

Today, many of these themes are present but visible in new ways. No one faulted President Trump for exaggerating the risk of the pandemic. On the contrary, Trump initially resisted calls for a massive federal response to the pandemic, and even after he gave in, he has dragged his feet and repeatedly promised to lift restrictions as soon as possible. Critics who expected that Trump would seize dictatorial powers the moment he had a chance, following the model of Victor Orban in Hungary, have been discomfited. The major conflicts between government power and civil liberties have thus played out at the state level. While large numbers of Republican voters joined Democrats in cheering on the governors—Democratic and Republican—who acted forcefully and early, the backlash has begun.

The most striking instance was a case decided on Easter Sunday in Louisville, Kentucky. The governor of Kentucky had earlier banned mass gatherings, and the mayor of Louisville said (or was mistakenly interpreted as saying—it’s not clear) that this ban extended to drive-in religious services. On Fire Church asked a federal district court to allow it to hold an Easter service in which congregants would stay in their cars with windows partly rolled down, six feet apart, while the service was broadcast to them.

The court held that the order as applied in this instance violated the U.S. and Kentucky constitutions, and Kentucky law. The striking aspect of the opinion was not the holding, which is probably defensible under Kentucky law—though the judge botched federal constitutional law, which allows generally applicable laws like shutdown orders to burden religious groups. It was the rhetoric. The opinion begins with a Sunday school sermon on the history of religious persecution from biblical times to the present and all but accuses the Christian mayor of a predominantly Christian town of using the pandemic as a pretext to persecute Christian worshippers. “On Holy Thursday, an American mayor criminalized the communal celebration of Easter,” the judge announced in the first line of the opinion, commenting that this was the stuff of a “dystopian novel.” The governor of Kentucky and the mayor of Louisville are Democrats, while the judge is a Trump appointee who has been nominated to the prestigious U.S. Court of Appeals for the District of Columbia Circuit.

The case is all the more striking because more than a century ago, in Jacobson v. Massachusetts, the Supreme Court held that governments should enjoy significant freedom when taking public health measures to stop contagions. The court upheld a mandatory vaccination law during a smallpox epidemic despite legitimate concerns that it would cause harm to many people. A recent Pennsylvania state Supreme Court decision is far more in line with the Supreme Court’s jurisprudence than is the Kentucky case. The political campaign of a local politician and several businesses challenged a stay-at-home order for infringing First Amendment rights to engage in political action and to assemble, and rights to property (because businesses were destroyed), equal protection (because the shutdown burdened challengers more than incumbent politicians), and due process (because businesses could not challenge shutdown orders). The court brushed aside these arguments because of the emergency conditions.

After 9/11, the courts largely stayed out of the way as the federal government ramped up surveillance, detention, military and related actions. An increasingly conservative Supreme Court saw eye to eye with the Bush administration, and the few roadblocks imposed by courts were swiftly removed by Congress with laws that expanded surveillance, detention and related authorities.

The road ahead for pandemic law seems more complicated. Increasingly conservative courts throughout the United States will likely be receptive not only to religious claims but also to demands based on the loss of property and infringements of gun rights. Governments’ restrictions on people’s freedoms have been far more massive and widespread than they were after 9/11, when the restrictions were focused on a relatively small group of people. This will lead to all that much more litigation and the possibility that courts will be receptive despite the Supreme Court precedent, which is ambiguous enough to allow more aggressive judicial review.

And that brings us to the main question: What should courts do when people challenge pandemic containment measures imposed by state governments and the federal government? After 9/11, many commentators recommended a middle road between judicial passivity and aggressiveness, arguing that courts should tolerate restrictions of civil liberties as long as actions by the executive branch received endorsement from Congress. The idea was that the legislature could supply a check when the executive was tempted to act too aggressively and would not acquiesce in attempts by the executive to increase its power. Critics responded that this would not prevent the government as a whole from discriminating against minorities.

Be that as it may, a similar approach today does not seem practical. Legislatures often cannot meet during a pandemic, or can meet only with difficulty, and in any event there seems to be little legislative opposition to the governors’ stay-at-home orders. That said, if the Kentucky legislature forcefully endorsed the prohibition on drive-in religious meetings, it would have been harder for the federal court in Louisville to argue that the mayor’s action belonged in “the pages of The Onion.”

Another possibility is for courts to focus on protecting the people’s right to hold government officials accountable for their actions. Even if the president and governors need a free hand to combat the pandemic, we should ensure that the public retains the power to throw them out of office if their decisions turn out to be bad ones. One could imagine courts imposing a stricter form of judicial review on stay-at-home orders that burden political campaigns and elections than on orders that burden religious practices, business, the right to travel and gun possession.

But this approach would not likely satisfy people either. Liberals are anxious because several red state governments have restricted abortion procedures as “non-essential.” Most, but not all courts, have struck down these restrictions. Challengers believe that state governments have used the pandemic as a pretext for restricting abortions, while the governments argue that abortion procedures sap medical resources that should be used to fight the pandemic. This argument parallels the dispute over the ban on drive-in religious services—though the court’s view that the mayor was looking for a pretext to suppress religion is far less plausible.

Whatever one’s views about abortion and religious freedom, one can hardly feel much confidence in the court’s ability to evaluate containment and mitigation orders. Was the ban on drive-in services excessive because the social-distancing measures employed by the church were adequate for preventing contagion? Or are authorities entitled to err on the side of caution? The court’s holding opens up the possibility that any order that shuts down squares, parks, malls or other public areas will be challenged by people who claim that they will exercise their constitutional rights at a distance of six feet. If hospitals are overwhelmed by a flood of infected patients, are courts the right institutions for determining which procedures will be preserved and which will be denied?

All of this suggests the wisdom of the Supreme Court’s opinion in Jacobson. Courts should defer as much as possible to the decisions of political authorities during a pandemic. The reason is not just that political officials, unlike judges, are accountable to the public and have access to more information about the likely course of the pandemic, the measures that are most responsive and the likelihood that the public will cooperate. An even more pressing concern is that the polarization of our politics has infected the judiciary. It is becoming increasingly likely that judges’ personal views about abortion, religion and other controversial practices will play a prominent role in their opinions, further inflaming our culture war and eroding public confidence in the judiciary at a time when the legitimacy of all branches of government are under attack.