“Congress, factious, domineering, tyrannical Congress has undertaken to poison the minds of the American people,” the embattled president declared in fiery speeches. His political foes have been aided, he charged, by their “hirelings” in a “mercenary and subsidized press.”

The president was Andrew Johnson, who in 1866 was already facing impeachment threats just a year after succeeding assassinated Republican President Abraham Lincoln. So Johnson sought to rally his supporters in speeches outside of Washington in much the way President Trump has done for months.

Johnson, a Tennessee Democrat, was under attack from Radical Republicans in Congress for his post-Civil War unity policy of bringing Southern white supremacists back into government. Although he was anti-slavery, he vetoed bills giving black Americans new rights, but Congress overrode his vetoes.

In the late summer of 1866, the 57-year-old president began an 18-day speaking tour to promote what he called “My Plan.” The trip’s purpose ostensibly was to travel to Chicago to lay a cornerstone for a monument honoring late U.S. senator Stephen Douglas. But “the unmistakable object,” the Philadelphia Press said, “is of course to influence the fall elections.” Johnson hoped to help elect more Democrats and moderate Republicans to Congress.

The route would take the president by train from Washington through Upstate New York, then as far west as St. Louis and back through Maryland. The press called it “Andy’s Swing Around the Circle.”

The presidential party left Washington on a special Baltimore & Ohio train at 7:30 a.m. on Tuesday, Aug. 28. The tour started off smoothly, with Johnson drawing big crowds in Baltimore, Philadelphia and New York City. In New York, headlines in the pro-Johnson New York Times blared: “Great Popular Demonstration of Regard And Esteem. Half A Million Of People Enthusiastic.” To help boost crowds, Johnson brought along Civil War heroes Adm. James Farragut and Gen. Ulysses S. Grant.

As the tour continued into Upstate New York, Johnson kept to his script. He boasted about his rise from a simple tailor in Tennessee. As the anti-Johnson Chicago Tribune put it, the theme was “Andrew Johnson, the humble individual who has filled every office from village alderman to President of the United States.”

But Johnson started to go off message in Cleveland, where the thin-skinned president angrily responded to hecklers. The president attacked the Radical Republicans in Congress led by Rep. Thaddeus Stevens of Pennsylvania, declaring, “He who is opposed to the restoration of the government and the Union of the states is a greater traitor” than former Confederate president Jefferson Davis. When a voice shouted, “Hang Jeff Davis,” Johnson yelled back: “Why don’t you hang Thad Stevens?”

Republican Sen. James Doolittle of Wisconsin, who was traveling with Johnson, later asked, “Mr. President, did you not lower your dignity in responding to the crowd?” Johnson responded: “— my dignity,” one Cleveland newspaper delicately reported. “I was bound to give ‘em back what they gave me.”

The backlash was fierce. One paper called Johnson’s Cleveland remarks “the most disgraceful speech ever delivered by any President of the United States.” Even the supportive New York Times admonished: “The president of the United States cannot enter upon an exchange of epithets with the brawling of a mob without seriously compromising his official character.”

In Chicago, Johnson drew a big crowd but a cool response. The Illinois governor and members of the Chicago City Council boycotted his speech.

Grant wrote to his wife, “I have never been so tired of anything before as I have been with the political stump speeches of Mr. Johnson. I look upon them as a national disgrace.”

In St. Louis, Johnson’s racist views surfaced. He said he had been “slandered” for vetoing civil rights laws for black citizens and called for favoring “the emancipation of the white man as well as the colored ones.” Because he dared to use his veto power, he said, some in Congress “clamor and talk about impeachment.”

He falsely accused “this radical Congress” of fomenting violence in New Orleans in July by encouraging black people there to arm themselves. Actually, white men with guns and clubs had attacked unarmed blacks marching in a parade and killed more than 40 of them.

Johnson bragged about pardoning 47,000 rebels: “I reckon I have pardoned more men, turned more loose and set them at liberty that were imprisoned than any other living man on God’s habitable globe.” When some called him a “Judas,” he compared himself instead to “the savior” who forgave repentant sinners rather than executing them.

Johnson became so incoherent that some observers speculated he was drunk. The Chicago Tribune headline on the speech read: “The Ravings of a Besotted and Debauched Demagogue.”

The president’s train tour was clearly going off the rails. “Mr. Johnson is badly afflicted with himself; added to which are a sensitive, irascible temper, a want of self-control and self-respect and a vehement, passionate haranguing style of speaking,” wrote the Springfield Republican, a Massachusetts newspaper. “Altogether these qualities are making a sad muddle of his speeches. He has no patience with the people who differ from him.”

Johnson’s speeches, which were sent by telegraph to newspapers around the country, stirred anger in the North. On Sept. 10, when the president tried to speak to a crowd in Indianapolis from his hotel balcony, he was shouted down by cries of “We want nothing to do with traitors.” Pro- and anti-Johnson forces clashed in the streets. Gunshots rang out, and one man was killed. A bullet later was found in the wall of Johnson’s empty hotel room.

By the time the train tour limped back to Washington in mid-September, the reviews were in. “For the first time in the history of our country,” wrote the New York Independent, “the people have been witness to the mortifying spectacle of the president going from town to town … on an electioneering raid, denouncing his opponents, bandying epithets with men in the crowd, and praising himself and his policies. Such a humiliating exhibition has never before been seen, nor anything even approaching to it.”

Some supporters of Johnson’s policies stuck with him. New York Democratic leader Samuel J. Tilden said: “Let no man say to me that Andrew Johnson sometimes makes passionate and often angry remarks; let no man say to me that he sometimes omits what the fastidious critic might call indiscretions. I see them not. I see him only rising in the distance.”

Voters delivered the final verdict in the 1866 election by overwhelmingly electing Radical Republicans to Congress. Doolittle estimated that Johnson’s speeches cost him 1 million voters.

On Feb. 24, 1868, Andrew Johnson became the first president ever to be impeached. The House vote was 128 to 47 along party lines. Ironically, one of the initial articles of impeachment was based on the very speeches Johnson had made to try to win support. The article charged that the president did “make and declare, with a loud voice certain intemperate, inflammatory, and scandalous harangues, and therein utter loud threats and bitter menaces as well against Congress.”

Though the article was dropped, Johnson’s swing around the country had come full circle. His Senate trial began March 5, 1868.

Correction: An earlier version of this version referred to Thaddeus Stevens as a senator. He was a representative.

Ronald G. Shafer is a former Washington political features editor at the Wall Street Journal and author of “The Carnival Campaign: How The Rollicking 1840 Campaign Of ‘Tippecanoe and Tyler Too’ Changed Presidential Elections Forever.”

Read more Retropolis: