IT WAS a showy gesture of defiance when local elected officials and sheriffs across Virginia and elsewhere declared themselves Second Amendment “sanctuaries” last year, suggesting or stating outright they would refuse to enforce new state gun-control laws. Those laws include, prominently, so-called red-flag bills under which police, relatives or others can seek a court order for law enforcement to confiscate a firearm from individuals deemed a threat to themselves or others.

It would be far more alarming if a local sheriff actually makes good on the threat — by refusing, for instance, to seize a weapon from a self-destructive son or daughter whose parents have convinced a judge that suicide may be imminent if law enforcement does not intervene. In that case, it would be not only irresponsible but also illegal, and quite likely would expose sheriffs personally, as well as the localities they represent, to liability in the event of an act of violence.

That’s not a far-fetched scenario. Of roughly 1,000 Virginians who die annually in gun violence, nearly two-thirds of them commit suicide.

Red-flag laws have been enacted in at least 17 states and the District. In Virginia, where Democratic victories in last fall’s elections gave them a majority in the state legislature, Gov. Ralph Northam, also a Democrat, is expected to sign a package of gun-safety bills, including a red-flag measure.

Gun-rights activists are free to denounce such laws; they are free to mount legal challenges to their constitutionality. But unless and until the laws are struck down by a court, no one is free to violate them.

To date, no red-flag law has been invalidated by a legal challenge, and the idea is well within the mainstream. Even President Trump, usually loath to embrace any gun-safety measure, endorsed the idea after mass shootings last August in El Paso and Dayton, Ohio — though he later caved to the gun lobby and dropped the idea.

Sheriffs and other law enforcement officers are sworn to uphold and enforce duly enacted laws. For a sheriff to refuse to enforce a protective order handed down by a court would be “an unspeakable betrayal” of his duties, Mark R. Herring, Virginia’s attorney general, told us.

Mr. Herring (D) and other Virginia officials doubt local law enforcement officials will go so far as to refuse a court order. But some localities in the Old Dominion, such as Tazewell County in the state’s southwest, have adopted absolutist-sounding resolutions vowing to defy “any act ordering the confiscation of firearms” except in the case of a felony convict or an individual found to be mentally incompetent.

That resolution and others like it were often adopted after swarms of gun-rights advocates jammed meeting rooms of local boards of supervisors. Some politicians may have played to the crowds without giving the measures a great deal of thought. Now would be a good time to reflect. The red-flag laws, like other gun-safety measures heading toward enactment in Virginia’s legislature, enjoy broad popular support, according to numerous polls. But whether they are popular or not, statewide or locally, is not relevant to a sheriff’s obligation to follow and enforce the law.

Read more: