There has already been a lot of second-guessing about Esteban Santiago-Ruiz, who killed five people and wounded eight at the Fort Lauderdale–Hollywood International Airport on Friday. Despite extensive psychological evaluations, many psychiatrists had failed to identify Santiago as a danger to others. One of Santiago’s brothers blames the government.

In November 2016, local police escorted Santiago to a psychiatric hospital. Relatives say that after being released, he received further psychological treatment at his home in Alaska. Shouldn’t the experts have picked up on the warning signs?

Identifying someone as mentally ill is a far cry from deciding that the person poses a danger. Psychiatrists themselves have a poor record of knowing who will become violent. But psychiatrists know that they can’t predict the future.

Look at the inability of psychiatrists to identify who will turn out to be a mass public shooter. It’s very common for mass killers to be seeing psychiatrists before their attacks. This includes Elliot Rodger (Santa Barbara), Ivan Lopez (the second Fort Hood shooter), Adam Lanza (Sandy Hook elementary school), James Holmes (Aurora movie theater showing Batman), and Seung-Hui Cho (Virginia Tech). Major Nidal Malik Hasan, who murdered 13 people at Fort Hood in November 2009, was himself an Army psychiatrist.

Rodger had been receiving top-quality counseling for years. One of his psychiatrists, Charles Sophy, is nationally renowned and the medical director for the Los Angeles County Department of Children and Family Services.

The Army psychiatrist who last saw Lopez found no “sign of likely violence, either to himself or to others.” While Holmes’s psychiatrist warned University of Colorado officials about his patient’s violent fantasies, she “rejected the idea” that the threat was sufficiently serious for him to be taken into custody.

As for Seung-Hui Cho, neither a court-appointed, independent psychologist nor a hospital psychiatrist found him to be “a danger to himself or others.” The judge decided it was not necessary to have Cho involuntarily committed.

These killers didn’t lack mental-health care. In 60 percent of mass public shootings during the Obama presidency, the killers had been receiving professional mental-health treatment. Even good psychiatrists failed to identify real threats.

Psychiatrists have every incentive to get the diagnosis right. Besides their own professional pride and desire to help, they are legally obligated to inform authorities of cases that they believe represent threats.

There is a whole academic literature devoted to this diagnostic failure. It has been suggested that psychiatrists become desensitized to danger or seek to prove their fearlessness. It’s possible that added training would help to improve diagnoses of unusual cases.

But it will always be hard to predict mass public shootings, which are extremely rare events. What seem like obvious telltale signs in retrospect are often not so obvious before the attack.

Schizophrenia alone can be found in roughly 1.6 million people nationwide. From 2009 through 2015, mentally ill individuals were responsible for 15 out of 25 mass public shootings. Even if all 15 individuals had schizophrenia (and that is clearly not the case), this comes to one mass public shooting for every 100,000 schizophrenics. To stop one person who is going to do something terrible, you could have to confine thousands of people who seem dangerous.

Are we going to disarm all mentally ill people, even though they themselves are at increased risk of violent crime? One woman I know saw her husband killed in front of her by a stalker. She was very depressed but did not seek mental help for fear that she would be denied the right to own a gun (which she needed to protect herself from stalkers).

There are no easy answers or inexpensive solutions. If someone poses a serious danger to others, the only solution may be to lock him up, Or to provide outpatient caregivers.

When someone really poses a danger to others, simply saying that he can’t legally buy a gun isn’t much of a guarantee that he will be prevented from getting one. He should be committed —involuntarily, if necessary — to a mental-health-care facility.

But if we can’t identify those who are a danger to others, let the law-abiding defend themselves. Florida is only one of six states with such a ban on carrying guns in unsecured areas of airports.

No one wants a dangerous person to have a weapon. But our mental-health system can’t be the last line of defense. Too many mistakes are made in the treatment of the mentally ill, and innocent people must be able to defend themselves.