Some of the most deplorable episodes in U.S. history involve the government wielding the power of the state against minority groups: Black people, Indigenous people and gay people, to name just a few. Though these campaigns might have received popular support at the time, history has consistently judged them as immoral, illegal and un-American.

Rather than understanding this history, President Trump is borrowing from the worst of it. One of the very first acts of his second term was to order the government to view gender as immutable and discriminate against transgender citizens. “As of today,” he declared in his Inaugural Address, “it will henceforth be the official policy of the United States government that there are only two genders: male and female.”

The early days of Mr. Trump’s second term have raised any number of concerns about actions that run dangerously counter to both the laws and the best interests of the country and its people. But the chaos of these past few weeks shouldn’t mask that in this period, he has also waged as direct a campaign against a single, vulnerable minority as we’ve seen in generations.

Within hours, this language began to be codified in a series of executive orders and actions attempting to exclude transgender people from nearly every aspect of American public life: denying them accurate identification documents such as passports, imposing a nationwide restriction on gender-affirming medical care for transgender youths, investigating schools with gender neutral bathrooms, criminalizing teacher support for transgender students and commanding the Federal Bureau of Prisons to force the estimated 1,500 transgender women in custody to be housed with men.

The broadside against transgender people was not unexpected. Anti-transgender politicians spent at least $215 million to scapegoat transgender people for a variety of social ills. The Republican Party has increasingly viewed attacking trans rights as a political winner, much as it did attacking civil rights during Richard Nixon’s presidency and attacking gay rights in George W. Bush’s. That posture was disgracefully reflected in the speed and glee with which House Republicans barred transgender women from using women’s restrooms on Capitol Hill after the election of Sarah McBride, the first openly transgender member of Congress. As for Mr. Trump, he won power by caricaturing and demonizing trans people; now he is using that power to harm trans people.

The Trump administration’s attacks come half a decade after the conservative-dominated Supreme Court ruled in Bostock v. Clayton County that discrimination against transgender people is sex discrimination under the Civil Rights Act of 1964. “It is impossible to discriminate against a person for being homosexual or transgender without discriminating against that individual based on sex,” wrote Justice Neil Gorsuch.

It should be recognized that society is still grappling with the cultural and policy implications of the rapidly shifting understanding of gender. There are some issues — such as participation in sports and appropriate medical care for minors — that remain fiercely debated, even by those who broadly support trans rights. There should be room for those conversations. But what shouldn’t be debated is whether the government should target a group of Americans to be stripped of their freedom and dignity to move through the world as they choose. This is a campaign in which cruelty and humiliation seem to be the fundamental point.

The fearmongering is all the more disproportionate, given how few people identify as transgender. They are a minuscule less than 1 percent of the American population. And they are 0.002 percent of college athletes — a population that’s been especially incendiary in the culture wars.

In the U.S. military, slightly more than 1 percent of troops are transgender. That makes the Pentagon the largest employer of transgender people in the country, and that has made military service a prime target for the anti-trans movement.

So it was especially dispiriting, and symbolically important, that another of the new president’s executive orders aimed to oust openly transgender soldiers from the armed services and bar others from joining. In this move Mr. Trump took aim both at people who have put their lives on the line for their nation and at an institution that has historically played a critical role in debates over the recognition and integration of minorities.

The order called for imposing federally mandated discrimination against the estimated 15,000 to 25,000 Americans who have agreed to put their lives on the line to defend the nation. He offered no evidence that this order would remove unqualified people from the armed forces or make the United States safer, because there is none. The language of the order was notable in part for its meanness.

“Expressing a false ‘gender identity’ divergent from an individual’s sex cannot satisfy the rigorous standards necessary for military service,” the order said. “Beyond the hormonal and surgical medical interventions involved, adoption of a gender identity inconsistent with an individual’s sex conflicts with a soldier’s commitment to an honorable, truthful and disciplined lifestyle, even in one’s personal life.”

Not only does this order erase the honorable service (and potentially the pensions) of soldiers who led infantry patrols in Afghanistan and flew combat missions over Syria; it attempts to deny that they exist as transgender people at all. “A man’s assertion that he is a woman, and his requirement that others honor this falsehood, is not consistent with the humility and selflessness required of a service member,” declared the order.

The thousands of transgender soldiers who have served with distinction and honor for nearly a decade easily put the lie to the idea that they are unfit for service. Meanwhile, the notion that the existence of openly transgender soldiers is harmful to unit cohesion — long the go-to excuse for opponents of allowing Black people, women and gay people to serve in the armed forces — is contradicted by numerous, rigorous studies. The most comprehensive, by the RAND Corporation, examined other countries that allow transgender soldiers to serve openly and found “little or no impact on unit cohesion, operational effectiveness or readiness.”

The first Trump administration was thwarted in 2017 by the courts in its efforts to bar transgender Americans from serving their country. The Biden administration reversed that policy before the courts could rule. Transgender troops have served openly, many on overseas deployments, without incident for the past four years, much to the ire of conservatives. “Transgender people should never be allowed to serve. It’s that simple,” Pete Hegseth, now the defense secretary, wrote in his most recent book.

Within hours of its signing, this executive order was challenged in court by six active-duty transgender service members and two seeking to re-enlist. Mr. Trump’s executive orders have often been enjoined by the lower courts, and it is important not to overstate the power that the president has to make radical change absent a sign-off from Congress — even as he appears to be trying to erode those guardrails.

Yet it is difficult to imagine another cohort of thousands of service members, kicked out of the military for reasons totally unrelated to performance or a willingness to follow orders, with barely a whimper from the country’s hundreds of pro-military and veterans’ groups, pundits and elected officials.

It’s true that Americans are divided by the new and shifting politics around gender identity. But most, regardless of party, have a shared respect for their fellow citizens who put on a uniform, pick up a rifle and travel around the world in defense of the nation.

Mr. Trump’s targeting of transgender Americans will go far beyond the military. And his instinct for demonization, his habit of dividing the public into those worthy of protection and those who should be cast aside, his habitual cruelty to those who can be pushed around without others speaking up will go far beyond a campaign against this one small, vulnerable group. As these campaigns continue, Americans would do well to remember the hard-won lessons of our history.