Grant. By Ron Chernow. Penguin Press; 1,104 pages; $40. To be published in Britain by Head of Zeus in November; £30.

IN 1948, a survey of historians ranked Ulysses S. Grant as the second-worst American president. Corruption had badly tarred his administration, just as it had that of the man at the bottom, Warren Harding. But recent surveys have been kinder. Grant now lands in the middle, thanks to his extraordinarily progressive work on race relations. “Treat the Negro as a citizen and a voter—as he is, and must remain,” he told Congress in 1874, close to a century before the South would finally consent to doing so. The victorious general in the civil war, Grant tried to see that the principles his men had fought for endured.

Ron Chernow’s 1,100-page biography may crown Grant’s restoration. The author of defining books on George Washington and Alexander Hamilton—the latter formed the basis for a hit Broadway musical, after Lin-Manuel Miranda read it on holiday—Mr Chernow argues persuasively that Grant has been badly misunderstood. The corruption in his administration never touched him—the soul of integrity—personally. Sometimes portrayed as an ignorant drunk, he was in fact a profound thinker with a sensitivity to suffering that underlay his kindness to vanquished armies and people of other races. His bibulous reputation was exaggerated by his opponents, Mr Chernow believes, and indeed with discipline and the support of his beloved wife, he abstained from drinking almost fully during his presidency.

Grant may have been America’s most improbable president. His early military career showed flashes of brilliance before he resigned from a post in California amid accusations, almost certainly justified, of drunkenness. He then failed at various business ventures, a lifelong tendency that accompanied a penchant for trusting swindlers. Not long before the civil war he was virtually broke, walking the streets of St Louis in shabby clothing selling firewood.

War brought salvation. The Union army was afflicted with generals who hesitated to engage, or failed to follow up victories by chasing vulnerable opponents. Not Grant. “I can’t spare this man; he fights,” Lincoln supposedly said of him, a year before the general engineered a landmark victory at Vicksburg, Mississippi, in 1863. Robert E. Lee, his chief opponent, concurred: “He is not a retreating man.”

Lee has been lionised by those nostalgic for the South’s “Lost Cause”. Mr Chernow argues that “however brilliant Lee was as a tactician, Grant surpassed him in grand strategy.” Far from embracing blunt butchery, as critics maintain, Grant saw the political dimensions of the war and patiently crafted its endgame, even if it was painfully bloody. His legendary magnanimity at Appomattox in 1865 was part of that political calculation: he allowed Lee and his men to return home with dignity, keeping some possessions like horses, and without fear of treason charges.

The defining issues of Grant’s presidency, from 1869 to 1877, became the reintegration of the Union and the maintenance of civil rights for blacks. On these, he excelled. Intolerant of unreconstructed white terrorism, including the Colfax massacre of at least 73 (and perhaps many more) blacks in 1873, he ordered federal authorities in the South to take the strongest possible measures to stamp out violence. He helped push through the 15th Amendment, which gave male citizens of all colours the right to vote. “To Grant more than any other man the Negro owes his enfranchisement,” wrote Frederick Douglass, a black leader and a frequent White House guest. It did not stop there. Grant named blacks, Jews and native Americans to federal positions. Small wonder, then, that he has risen in the presidential pantheon, while Woodrow Wilson, who segregated much of the civil service in the early 20th century, has sunk.

But Grant’s record in the White House remains mixed. His appointments were “brilliant and disastrous”. Corruption in the form of gold speculation and whiskey-tax evasion reached deep into his administration, a sign of the oncoming Gilded Age. In foreign policy, he showed a peculiar obsession with annexing the modern-day Dominican Republic. But he did notch up a major achievement: settling American claims over Confederate sympathies among the British, who had built the CSS Alabama, a ship that destroyed many Union commercial and naval vessels. The settlement, achieved through an international panel of arbitrators, may have averted a trans-Atlantic war and, says Mr Chernow, “launched a new fraternal relationship of great consequence”.

Grant’s push for racial equality did not endure, of course. The North wearied of the expense of keeping federal troops in the South, and the disputed election to choose Grant’s successor, in 1876, resulted in a deal to end Reconstruction. The Klan rose viciously again. Would things have been different had Lincoln lived, his full presidency followed directly by eight years of Grant, without an interruption for the retrograde Andrew Johnson? It is unknowable. In a remarkably pithy memoir, written while he was dying, Grant forecast this: “As time passes, people, even of the South, will begin to wonder how it was possible that their ancestors ever fought for or justified institutions which acknowledged the right of property in man.” Imperfect the 18th president may have been, but he was certainly far-sighted.