A century apart, two American presidents faced a world spinning out of control. One was a builder and the other a disrupter. But they have more in common than might be expected.

In most ways, Woodrow Wilson and Donald Trump could not be more different. Wilson was a man of faith, a Ph.D. who wrote books and lectured widely; as president, he oversaw the greatest progressive reform in history. Trump is a hedonist and subliterate boor who seeks to strip away any program that serves people in need or common concerns like the environment or global warming.

But the parallels are striking too. Both experienced periods of physical and mental instability that made close observers wonder whether they should stay in office. Both were prone to fits of temper and conspiracy theories. Both demanded absolute loyalty—and exiled those who spoke their minds. Both complained about entrenched elites conspiring to sabotage their world-changing agendas. Frustrated with the tedious bargaining in Congress, both took refuge in the roar of the crowds at rallies and parades.

One quality above all else—psychological fragility, and an all-encompassing fear of failure and humiliation—defined both presidents’ lives and their approaches to power. Their brittle but defiant egos made them unwilling to work with others. That offers sobering lessons for our time.

A hundred years ago, when Woodrow Wilson returned from the Paris Peace Conference, he experienced an unusual case of writer’s block—an unusual malady for the most voluble president in history. The problem, he said, was that he had “very little respect for the audience,” the Republicans who took control of the Senate in the 1918 midterm elections.

For his whole career—as a professor, university president, governor, and U.S. president—Wilson used words to overcome his painful shyness and promote his causes. When he got stuck, he withdrew from Washington and took to the road.

Historians have long debated Wilson’s psychology. Both parents were demonstrative but also demanding. Like Trump’s father Fred, Wilson’s father Joseph guided him but also mocked him when he failed. His mother Jessie was a relentless hypochondriac who, passively aggressively, demanded her son’s attention. Late in learning to read, Wilson turned inward to a fantasy life. He learned how to fit in by standing out, always aloof. Speechmaking was his path to power.

In his first term, Wilson was a model president. After laying out a reform agenda, he allowed Congress to do its work. At appropriate times, he bargained and compromised on the Federal Reserve Act, the Underwood Tariff Act, Clayton Anti-Trust Act, the creation of the income tax, and labor reform. When the European war broke out in 1914, Wilson argued successfully for neutrality, then for preparedness. After winning reelection in 1916, Wilson quickly changed and went all-out for war.

Emotionally, he shut down when he faced opposition. When he called for “war without victory,” Republicans like former President Theodore Roosevelt and Senate Majority Leader Henry Cabot Lodge hissed. But he would not engage them. When he went to Paris to push for the League of Nations, the English and French agreed in exchange for carving up the territory of the defeated Central Powers and exacting punishing reparations against Germany.

To Wilson, the League was the prize. This entity—less than a world government but more than a treaty—would, he said, prevent 98 percent of future wars. It would also provide the authority needed to solve other problems, like labor relations, trade, freedom of the seas, arms control, colonialism, and human rights.

Republicans (and some Democrats) feared the League would cede American sovereignty to European powers and, soon, to “colored” nations. Senator James Reed of Missouri, a Democrat, complained: “Think of submitting questions involving the very life of the United States to a tribunal on which a nigger from Liberia, a nigger from Honduras, a nigger from India… each have votes equal to that of the great United States.”

Even before Wilson went to Paris, Lodge assembled an opposition coalition: isolationists (like Hiram Johnson), realpolitik balance-of-power advocates (like T.R.), and middle-of-the-roaders (like Porter McCumber). Wilson tried, gamely, to persuade them. He met reluctant senators for one-on-one talks but converted no one. He hosted the Foreign Relations Committee but converted no one.

The more Wilson spoke, in fact, the more he alienated one faction or another.

But Wilson was, above all, a talker. And so, 100 years ago this month, he embarked on the most ambitious speaking tour in presidential history: 10,000 miles, 20 states, 27 cities, all on a hot steel train, swaying up and down mountains and through forest fires—hell on the fragile man’s constitution. He spoke mostly in places where he would not be able to persuade reluctant senators to change their minds. Back in Washington, Lodge and the Republicans tended to their swelling anti-treaty coalition.

Most Americans favored the treaty, but with little fervor. Most supporters agreed that “reservations” were needed to protect American control over war-making powers, maintain the sanctity of the Monroe Doctrine, and enable the U.S. to quit the league if it worked against American interests. Mostly, though, people wanted to get on with their lives after years of war.

American life in 1919 was in state of crisis, with unprecedented labor strikes, race riots, growing inequality, depressed wages and spiraling prices, a rough transition from a wartime economy, sweeping attacks on immigrants, systematic attacks on civil liberties, and the first Red Scare (even as thousands of Americans were stuck in Russia fighting an undeclared war).

The ugliest problem was, as always, race. Many blacks thought they finally earned respect when they volunteered for the war and manned factories and railroads at home. Whites resented their claim to the American Dream. Riots broke out in Chicago, Washington, Omaha, and Elaine, Arkansas, among other cities, claiming at least 153 lives. Lynchings claimed 83 lives. In Omaha, white mobs set fire to a jailhouse, seized a black man suspected of rape, shot him up until his entrails spilled out of his chest, then burnt his body in a bonfire. Smiling photos by the burnt remains were sold as postcards.

(Wilson had no inclination to confront the race issue. A child of the South, he restored segregation to the federal bureaucracy. He screened the racist film “Birth of a Nation” at the White House—though his famous praise for it, “like writing history with lightning,” might have been apocryphal. The movie was based on a novel by a friend from Johns Hopkins University, who peppered him with ideas for tightening race laws to make the Democrats the majority party.)

Workers staged more than 2,000 strikes. Many turned violent when management, Pinkertons, and state and local cops attacked them. When Boston police struck in September, the taciturn governor Calvin Coolidge sat silent while Bostonians rioted; then, when the police gave in, he had the cops fired and replaced.

Attacks on civil liberties—which began with the Espionage Act of 1917, the Sedition Act of 1918, and the Alien Act of 1918—ramped up with the strikes and terrorist attacks. The postmaster general wouldn’t deliver hundreds of publications deemed insufficiently pro-American. A young bureaucrat named J. Edgar Hoover began to collect a database of names he considered subversives for the Bureau of Investigation. During the war, the feds tapped a nationwide network of citizen spies who ratted on German-Americans and other “hyphenated” Americans—an impressive resource for continued repression. The American Protective League alone had 200,000 citizen-spies, who infiltrated virtually every major institution, including the NAACP.

Labor leaders and socialists who spoke out against the war, including four-time Socialist presidential candidate Eugene Debs, languished in jail. (Debs would run for president again in 1920, while in jail.) Privately, Wilson acknowledged at least some of the dissidents should be freed but his bitterness stayed his hand. The next president, Warren Harding, would ultimately make some healing gestures.

On his Western tour, Wilson struggled to get to know his country again. He alternated between high-minded appeal, and low-down ones. Rather than acknowledging honest concerns, he repeated that the League of Nations would prevent “98 percent” of future wars. He offered detailed explanations of complex issues like Article X (the cooling-off provision, which mandated arbitration and boycotts before war) and Article XI (the busybody provision, which required member nations to raise complaints when they saw misbehavior by other nations). But he could not resist demagogic appeals against Germans, Russians, Republicans, laborers, and others.

Wilson’s tour revealed some of the nation’s fault lines. In Columbus, Republicans worked behind the scenes to dampen turnout for the parade—then went all out to create a rousing welcome for a gathering of Civil War veterans. In North Dakota, where the socialist Nonpartisan League governed, he faced leftist skeptics about his policies on war, labor, and civil liberties. In California, Chinese critics panned the treaty for giving Shandong to Japan. Wherever he went, Irish critics attacked his subservience to Britain—especially the provision that allocated six votes to England and other members of the British Empire.

In Seattle, where the radical syndicalist Wobblies had organized a general strike in January, protesters rebuked him by standing silent for six blocks of an otherwise joyous parade. The silent attack humiliated the president; one moment he was happily waving a top hat, the next he was crumbled and gray in his seat. Jack Kipps, the man who organized that silent protest, instantly regretted it. “I felt like two cents for pulling that demonstration,” he said. Mournfully, he called himself Wilson’s assassin.

For most of the trip, Wilson aroused excitement. Few people then ever saw or heard a president. A president’s presence alone was a cause for patriotic celebration. But after Wilson left town, a Republican “truth squad” often took his place in the city auditorium and fired up the crowds against Wilson. Many of the opposition’s crowds were bigger; most were more raucous. “Impeach him!” the crowd at a Chicago rally called out.

But Wilson scored some victories. In California, the home of a leading opponent, Senator Hiram Johnson, the president’s speeches rallied more than 100,000. The editor of the Republican Los Angeles Times declared Wilson and his cause triumphant. Even though no senators flipped to the pro-treaty side and at least a handful moved toward the anti-treaty side, the size and enthusiasm of the crowds indicated a nationwide shift.

At least that’s what the Wilson party thought leaving southern California for Nevada, Utah, Wyoming, and Colorado.

Wilson had suffered serious ailments—gastrointestinal problems, splitting headaches, and (according to later medical historians) a series of strokes—all his life. At the Paris Peace Conference he spent a week in bed with a mysterious ailment, probably the Spanish Flu (which originated at an American army base). In Paris, he appeared to lose his mental stability; he accused servants of spying and stealing furniture. Aides whispered about his mental health.

On the Western tour, Wilson rarely got a good night’s sleep. He struggled to eat—sometimes he could only drink black coffee—and had to be propped up by a window so he could breathe and get some rest. Alas, his doctor was not much of a doctor. Wilson hired him more for his bonhomie and unflagging devotion. Dr. Cary Grayson’s prescription for Wilson’s ailments was play, especially golf (he once took 26 shots on a single hole) and auto rides through Rock Creek Park. But on the Western trip, Wilson could rarely escape even to take a walk.

Just before the scheduled end of the tour, Wilson collapsed and was returned to Washington—where, three days later, he suffered a stroke that left him an invalid. When his secretary of state convened a Cabinet meeting to discuss his health emergency, the president fired him. Alone with his wife and a few aides, he ordered Democrats to vote against compromises that would have saved some form of the treaty.

A quarter-century later, after another world war, the U.S. and its allies constructed a new world order based on mutual-protection pacts like NATO and the United Nations. Had Wilson compromised, the League of Nations might have evolved to fill those kinds of roles. Another global conflict might have been avoided. Now, Donald Trump has done his best to unravel these organizations and other agreements, like the Paris climate accord and the Iran nuclear pact. What Wilson started, Trump aims to rip apart.

Wilson’s insecurity made him a gambler. Rather than bargaining, he bet everything on big ideas, big speeches, big gestures. Even when the Senate rejected the treaty in November 1919 and March 1920, he wanted to double down. Alone in a dark room in the White House, now an invalid, he fantasized about running for president again in 1920. He also entertained ideas about a national referendum on the League.

In that sense, Wilson resembled the current president who declares that “I alone can fix it” and calls himself “the chosen one.” Wilson believed in his singular role in history. “Remember that God ordained that I should be the next president of the United States,” he told one party leader.

Still, when his party moved on from him in 1920, Wilson accepted it. “We are still in darkness but I am sure that it is the darkness that eventually lightens,” he told a visitor after leaving the White House. “I realize now that I am only… a tool that has served the purpose in God’s hand. I was stricken because it was His way of doing things. It was His will to set me aside; He knows what is best.”