Two hundred years ago this spring, an ambitious and bellicose rear admiral, George Cockburn, steered a small squadron of British naval vessels into the Chesapeake Bay. Through April and May, Cockburn became the most hated man in America as he enthusiastically plundered whatever he laid his eyes on, sending back boatloads of booty to British military headquarters in Halifax, Nova Scotia. “I have no hesitation,” Cockburn wrote his commander, “in pronouncing that the whole of the shores and towns within this vast bay, not excepting the Capital itself will be wholly at your mercy . . . or destroyed at your pleasure.” And he was right.

The law of unintended consequences operates with unique force when a war is launched. We know that all too well. Two centuries ago, Americans discovered even more painfully how true it was.

At the time, Britain and France were engaged in a titanic struggle. Britain had a first-class navy, and Napoleon had put together the greatest fighting forces the world had seen. The new American nation was suffering from that war’s collateral damage — to its merchant fleet and its pride. Both the British and the French refused to recognize the country’s neutrality, seizing any ships that might aid their enemy. More provocatively, the British navy, starved for manpower, pressed American seamen into coerced service.

First-term Southern and Western members of Congress began screaming for retribution. Mild-mannered President James Madison, driven to desperate measures, advised Congress to declare war on Great Britain. And it did so in June 1812.

Here is where the law of unintended consequences kicks in. Madison didn’t want a fight; he wanted to stop the depredations on American commerce, so he devised a strategy of invading Canada in the hope that this would force Britain to the peace table. Instead the Canadian campaigns, headed by old Revolutionary War veterans, floundered. It took a year for Madison to find any talented leadership for his woefully unprepared army.

’Through the Perilous Fight: Six Weeks that Saved the Nation’ by Steve Vogel (Random House)

One of the assumptions Madison and others labored under was that Britain would be too preoccupied with beating Napoleon to pay much attention to its quondam colonies. But alas, the British defeated Napoleon and dispatched him to Elba in the spring of 1814. The hero of the hour, the Duke of Wellington, was ordered to ready an expeditionary force of “Wellington Invincibles” for quick dispatch across the Atlantic to teach the Americans a lesson and perhaps even break up the union, which was only 37 years old.

In “Through the Perilous Fight,” Washington Post reporter Steve Vogel does a superb job of bringing this woeful tale to life. He leavens his fast-paced narrative with lively vignettes of the principal participants in this folly, beginning with Cockburn and Francis Scott Key, the one person most Americans remember from this forgettable war as the author of those daunting soprano lines: “And the rockets’ red glare, the bombs bursting in air.”

Key, a Federalist, was also a devout Episcopalian who recoiled from the American strategy of attacking Canadians who had nothing to do with them. Cockburn shared none of Key’s peace-loving sentiments. Americans compared him to Attila the Hun, conveniently forgetting that their troops had left hundreds of people out in the cold after burning down an Ontario town in the dead of winter.

Vogel’s story takes on dramatic intensity with the arrival in the New World of a fleet of British ships-of-the-line, transports, bomb ships, frigates, schooners and sloops-of-war — 45 vessels in all — to support 4,000 troops, many from regiments that had fought the Americans in the revolution. Cockburn now had the force he needed to march on the capital.

Here the whole affair takes on the air of comedy. The American secretary of war, John Armstrong, refused to believe that the British would attack Washington. Looking out on the cattle and sheep grazing between the Capitol and the White House, he asked, “What the devil will they do here?” Less sanguine, Madison called for a force of 15,000 to defend the capital, but only 250 militiamen — most of them lawyers and merchants armed with squirrel guns — materialized while the British fleet was advancing up the Patuxent River in Maryland. Secretary of State James Monroe, another Revolutionary War veteran, led a scouting party to determine the size and target of the British force, only to discover that he had forgotten to bring along a spyglass and couldn’t count the ships.

Vogel meticulously sets the stage for the ensuing debacle as untrained American troops and overcautious officers quickly faded from sight with the approach of the British regulars. The commanding general, Robert Ross, arranged a truce with the townspeople of Upper Marlboro whereupon the leading citizen, Dr. William Beanes, played the gracious host, opening up his famous wine cellar.

Arriving unchallenged in D.C., Cockburn and Ross cooperated in a plan to burn all the public buildings in the capital while respecting private property. The Americans themselves destroyed their new navy yard, but the British torched the White House, the Capitol and the Library of Congress while American officials, including Madison, scattered for safety.

All this went on as British and American peace missions parlayed in Ghent, British demands escalating with news of the occupation of Washington. John Adams, Henry Clay and Albert Gallatin, the American negotiators, were as likely to dispute with each other as with the British. The censorious New Englander Adams was aghast at Clay’s sybaritic ways — sometimes Adams would rise as Clay was ending the night’s activities — while Gallatin, ever the moderator, settled their differences.

After their unopposed march to Washington, the British spent two weeks deciding whether to march on Baltimore. At last the Americans acquired some starch and some time. They fortified Fort McHenry, sank ships to block the British navy and drew in regular and militia forces from neighboring states.

Vogel spreads wide his net for evidence, finding pithy quotes in diary entries kept by privates and generals, exchanges between Dolley Madison and her many correspondents, letters that eyewitnesses sent home, and many newspaper accounts. As good a writer as he is, though, it sometimes requires the avidity of a military buff to maintain interest in the level of his detail about the minute actions of Royal Marines, light brigades, expeditionary forces, tree-climbing sharpshooters and fighting flotillas. It’s all there.

In a variation of no good deed goes unpunished, the hospitable Beanes became the target of Ross’s ire when Beanes and several neighbors caught three stragglers after the British left. When time permitted, Ross dispatched a squad in the dead of night to take Beanes prisoner.

It fell to Key to negotiate his release. Arriving just as the British were perfecting their plan of attack on Baltimore, Key was confined to a truce ship to wait until the confident British had secured the city. Thus did Key get a ringside seat on the Battle of Fort McHenry. Torrential August showers added to the fog of war. The ferocious bombardment from both sides could be seen and heard for miles.

The lyrics to “The Star-Spangled Banner” tell the rest of the story.

The Americans repelled the British, who retreated to Bermuda, a chagrined Cockburn laid low by the death of Ross. A victory in Canada added to the winning momentum, climaxed by Andrew Jackson’s great triumph at New Orleans, too late to affect the already drafted peace treaty but just in time to propel him to national fame.

With no more War of 1812 to report, Vogel ends his fine study with an epilogue detailing Cockburn’s 72-day voyage to St. Helena, escorting Napoleon to a 47-square-mile rocky island in the South Atlantic. Ever the pugilist, Cockburn let the emperor know who was now boss. The wars had finally ended.

Related: Q&A: The Star Spangled Banner, Francis Scott Key and the War of 1812

Joyce Appleby is a professor of history emeritus at UCLA and the author of “The Relentless Revolution: A History of Capitalism.”


Six Weeks That Saved the Nation

By Steve Vogel

Random House. 534 pp. $30