He had been a polarizing president, cherished as well as deplored for his excitability, his stubbornness, his gift for demagoguery. A hair-trigger sensitivity to slights made him self-pitying and prone to a corrosive paranoia. He railed against establishment elites and gave succor to white supremacists. He rejected congressional oversight and barreled forward, declaring that he could hire and fire whomever he wanted, even as his impetuous dismissals drew complaints that he was obstructing justice.

By February 1868, President Andrew Johnson had forced the moment to a crisis. As Brenda Wineapple recounts in her new book, “The Impeachers,” Johnson had been goading legislators with his accelerating attempts to rule by decree, daring them to “go ahead” and impeach him — which the House voted to do by an overwhelming majority, 126 to 47.

The author of award-winning works about Nathaniel Hawthorne and Emily Dickinson, among other books, Wineapple started to research her history of the country’s first impeachment trial six years ago; she briefly mentions Presidents Nixon and Clinton but not the current occupant of the White House. She doesn’t have to. The relevance of this riveting and absorbing book is clear enough, even if Wineapple’s approach is too literary and incisive to offer anything so obvious as a lesson.

Lincoln’s assassination in 1865 made Johnson an accidental president; he had been picked as Lincoln’s running mate less than a year before, as a politically expedient choice. Johnson was a Southerner and a Democrat who also happened to be an adamant Unionist — giving him rare and valuable currency in a country fractured by the Civil War. His first speech after Lincoln’s death was dignified, sober, statesmanlike — so much so that it worried white Southerners and heartened black community leaders. “As colored men,” the editor of the Black Republican newspaper in New Orleans announced, “we have entire confidence in President Johnson.”