Disturbing as it is, President Donald Trump’s xenophobic venom and media hatred aren’t unprecedented. The last time we had a similar outpouring from Washington, D.C., was almost exactly 100 years ago, and it too involved a flood of angry rhetoric and a fear of immigrants, as well as repression on an enormous scale.

It began suddenly, with intense anti-German sentiment following the U.S. entry into World War I.

Schools, colleges and universities abruptly stopped teaching the “Kaiser’s tongue.” Iowa forbade the use of German in public. In Shawnee, Oklahoma, a crowd burned German books to mark the Fourth of July. Berlin, Iowa, changed its name to Lincoln. Chicago’s Bismarck Hotel became the Hotel Randolf. Families named Schmidt became Smith.

In Collinsville, Illinois, a crowd seized Robert Prager, a coal miner, and lynched him because he was German-born.

In Washington, D.C., when a man failed to stand up as “The Star-Spangled Banner” was played, a sailor behind him shot him dead.

Congress rushed through the draconian Espionage Act, which outlawed anything that would “cause insubordination, disloyalty, mutiny, or refusal of duty in the military,” paving the way for a broader crackdown not just on potential German sympathizers but on labor organizers, the press and the political left.

The president who oversaw this particular flood was no Donald Trump, not in his manner anyway. Woodrow Wilson carefully kept his image as an above-the-fray idealist by outsourcing inflammatory rhetoric to others, including to his special emissary to Russia, Elihu Root.

Root embraced the role, declaring to an audience at New York’s Union League Club in August 1917 that “there are men walking about the streets of this city tonight who ought to be taken out at sunrise tomorrow and shot for treason. ... There are some newspapers published in this city every day the editors of which deserve conviction and execution for treason.”

The Espionage Act gave the Post Office great powers over the press, and newspapers were censored, editors jailed and publications shut down. Some 75 newspapers and periodicals either had specific issues banned or were forced to close entirely.

Vigilante groups sprang up across the country. The largest was the American Protective League, an official auxiliary of the Justice Department. With a membership that swelled to 250,000, its ranks regularly broke up anti-war meetings and, by the tens of thousands, beat up or made citizen’s arrests of suspected draft dodgers.

Since almost any industry could be deemed essential to the war effort at that time, the government and private industry took the opportunity to come down hard on the growing labor movement.

On Sept. 5, 1917, federal agents raided every office of the nation’s most radical union, the Industrial Workers of the World, known to all as the Wobblies. From the group’s Chicago headquarters alone, the raiders took five tons of material. More than 100 Wobblies were brought to trial in Chicago, charged with violating the Espionage Act for their organizing activities, and all were found guilty.

Even after the war ended in German defeat, the crackdown — including heavy press censorship — continued, for it had never really been about the war. The flood of vituperation, threats and arrests was part of a different kind of war, a struggle against those trying to rectify America’s staggering maldistribution of its bounty. In 1915, the richest 1% of the population owned 35.6% of the country’s wealth.

Adam Hochschild teaches at UC Berkeley’s graduate school of journalism and is the author most recently of “Lessons from a Dark Time and Other Essays.”