On a sunny Saturday in June, thousands gathered on the National Mall in Washington, D.C., to sing “The Star-Spangled Banner.” This year marks the two-hundredth anniversary of Francis Scott Key’s composition, officially adopted as the national anthem in 1931 following news that leftist members of the Erie, Pennsylvania, city council were opening meetings with a rousing chorus of “The Internationale.” As the melody rang out over the grass and along Constitution Avenue, it echoed off neighboring memorials and galleries, including the partly built National Museum of African American History and Culture a block and a half down the street.

Although preceded by a lengthy program of musical performances, the anthem itself got short shrift. As usual, only the familiar opening verse was sung, because of various ideological stumbling blocks in subsequent verses — most especially the third, with its fervent hope that

No refuge could save the hireling and slave

From the terror of flight, or the gloom of the grave.

For myself, the words always evoke a glow of family pride, because Key’s malign desire that fleeing slaves should find no refuge was directly inspired by the actions of my distinguished relative Admiral Sir George Cockburn of the Royal Navy. Two hundred years ago this August, he fought his way to the White House at the head of an army partly composed of slaves he had freed, armed, and trained and torched the place, along with the Capitol and much of official Washington. In the course of a two-year campaign, he rescued as many as 6,000 slaves, and despite Key’s hopeful verse, not to mention angry demands from the U.S. government, he sailed them away to freedom.

Obviously, the admiral qualifies as one of the great emancipators, and I am proud to claim a connection. In a recent conversation with Dr. Lonnie Bunch, who is overseeing the creation of the African-American museum as its director, I suggested that he include George Cockburn in a Hall of the Righteous, cheek by jowl with Abraham Lincoln and William Lloyd Garrison. He was nice enough to hear me out, although he made it clear that his intention is not to produce a black version of the nearby Holocaust Memorial Museum, with its Wall of Rescuers, but something far broader in scope. The real challenge, Bunch told me, is to avoid a “rosy view of the past. Romanticized memory is not history.” Workers have already installed a 1930s guard tower from the Louisiana State Penitentiary and a Jim Crow– era railroad car.

To maintain a rosy view of the War of 1812, it is best to concentrate on the tattered banner and its mythic survival amid British rockets and bombs. There is less romance in the full story. It was a war of aggression, launched by President James Madison in hopes of conquering Britain’s Canadian colony, thought to be easy prey while the British were distracted by their life-and-death struggle with Napoleon. Not for the last time, expert opinion expected a walkover. “The acquisition of Canada this year, as far as the neighborhood of Quebec, will be a mere matter of marching,” wrote Thomas Jefferson soon after war was declared. A fellow ringleader of the war party, Henry Clay, assured Congress that “the militia of Kentucky are alone [able] to place Montreal and Upper Canada at your feet.”

As with more recent enterprises, things did not go as planned, especially since the military was woefully unprepared and led by incompetent commanders. The Canadian expedition ended in disaster and large portions of Maine and Michigan fell under enemy occupation. By the time the British agreed to call it a day, the bitterly divided United States was war-weary and on the verge of bankruptcy.

By then George Cockburn was the most hated man in (white) America, vilified in the press as the “great bandit.” The scion of a Scottish landed family ruined by his speculator father, he had entered the navy at the age of fourteen. From then on, he was almost continually at sea — and, once war with France broke out in 1793, frequently in combat. This conflict, initially waged against revolutionary France and then against Napoleon, was essentially the first world war, fought across much of the globe and offering plenty of opportunities for a tough, ambitious professional such as Cockburn. At twenty-three, he was already a captain, in command of a 215-man frigate. Horatio Nelson, Britain’s greatest naval hero, would soon praise the young officer’s “zeal, ability, and courage, which shine conspicuous on every occasion which offers.”

By 1813, when he first arrived in Chesapeake Bay, Cockburn was forty-one years old and a rear admiral. His mission was straightforward: to inflict as much damage as possible on this economic heartland, thereby dissuading pro-war Democratic-Republicans (as opposed to antiwar Federalists) from their rash attack on the British Empire. “I have no hesitation,” he wrote to a superior officer, “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, and subject if not to be permanently occupied, certainly to be successively insulted [raided] or destroyed at your pleasure.”

This ruthless scheme, which Cockburn was to follow to the letter, would have been absolutely impossible without first-class intelligence operatives to alert his raiding parties to enemy forces and guide them around the tortuous shoreline. Fortunately, volunteers for such a mission soon appeared: slaves. At first they were single men, eagerly welcomed by the British as the pilots and guides they needed. But the numbers quickly grew as entire families made their way to the ships. At this point the invaders made a crucial decision: they would accept any slave — man, woman, or child — and guarantee they would not be handed back to their owners.

It was a shrewd assault on the young republic, which at the time was really two nations: a free people, intoxicated by their new democracy, and an enslaved people, ill-fed, clad in rags, and routinely brutalized. In fact, the revolution had in many ways made the lives of enslaved Americans even worse. For example, among the goals of Virginian Founding Fathers such as Jefferson had been the breakup of big landed estates. Whereas in colonial times such estates passed to a single heir (the eldest), they could now be divided equally among siblings. This meant that slave families, too, were increasingly broken up. In his pathbreaking history The Internal Enemy: Slavery and War in Virginia, 1772–1832, Alan Taylor points out that “the revolution had produced a tragic contradiction by promoting greater equality for white men while weakening the security of black families.” In addition, observes Taylor, “by diffusing slave ownership, the new laws also broadened public support for slavery.” A nascent movement in favor of emancipation that had flickered during the years of the revolution soon died away.

In Taylor’s view, family separation was the most onerous of all the miseries inflicted on enslaved blacks. Perpetually indebted Virginia and Maryland planters were happy to breed and sell surplus bodies, regardless of family ties, to the expanding cotton plantations of the deep South. So enslaved black men, especially those living within easy reach of the coast, led their families to the British in large numbers.

The British understood very well that slavery was their enemy’s Achilles’ heel, and when Cockburn and his fleet returned to the Chesapeake in the spring of 1814 after wintering in Bermuda, he was determined to take full advantage. His orders read:

Let the landings you make be more for the protection of the desertion of the Black Population than with a view to any other advantage. . . . The great point to be attained is the cordial Support of the Black population. With them properly armed & backed with 20,000 British Troops, Mr. Madison will be hurled from his throne.

On May 29, horrified planters had their first look at the next stage of the British scheme. A raid on Pungoteague, on Virginia’s Eastern Shore, featured the Colonial Marines, a regiment of former slaves now armed and trained on Tangier Island, Cockburn’s base in the middle of the bay. The rags in which their owners clothed them had been replaced by bright red uniforms, and they were eager for battle, rapidly putting the defending militia to flight. “I was highly pleased with the conduct of the Colonial Marines,” reported the raid’s commander, “every Individual of which Evinced the greatest eagerness to come to Action with their former masters.”

Cockburn, delighted with his recruits, noted happily that they excited “the most general & undisguised alarm” among the populace. He was certainly correct. “Our negroes are flocking to the enemy from all quarters, which they convert into troops, vindictive and rapacious — with a most minute knowledge of every bye path,” wrote an American commander in early August. “They leave us as spies upon our posts and our strength, and they return upon us as guides and soldiers and incendiaries.”

Raids along the coast in the spring and summer of 1814 left dozens of towns, plantations, and stores burned, with livestock and freshly harvested tobacco carried away. Yet these were merely precursors to Cockburn’s ultimate plan to strike at the heart of the enemy by raiding Washington itself. This, he calculated, would be a devastating psychological blow, discrediting the Madison Administration and drawing enemy troops away from Canada. Furthermore, the Americans had burned York, as Toronto was called in those days, so this could be billed as justified retaliation.

To enlist the support of his superiors, Cockburn invited the cautious army commander, General Robert Ross, along on a night raid to demonstrate the feebleness of the American defenses. He somehow forgot to mention that he had raided the same place three nights before, driving off the militia and cowing the local residents. The brass were duly convinced.

“Traditionally, the British fighting in America are portrayed as the blundering redcoats, prey to light-footed Americans sniping from behind trees,” Taylor told me. “But Cockburn was the resourceful, innovative, and flexible commander in this war, and a superb tactician. In fact, he was just the kind of commander that we admire today.”

The advance on Washington, with the Colonial Marines very much to the fore, was launched in the third week of August. As Cockburn had predicted, the American defenses were in a sorry state; a hurriedly assembled militia was swiftly routed on August 24 at Bladensburg, on the outskirts of the capital. Francis Scott Key, who as a militia officer had been busy offering unsolicited advice to the commanding general, was among those stampeding back to the city and beyond. Only an improvised U.S. naval artillery unit, partly manned by free blacks, made a stand.

Most significantly, the American collapse was accelerated by a rumor among the troops that a slave revolt had broken out in their rear. Walter Smith, a brigadier general of the District of Columbia militia, summarized the abiding paranoia in the ranks: “Each man more feared the enemy he had left behind, in the shape of a slave in his own house or plantation, than he did anything else.” The sight of the Colonial Marines, charging in the British vanguard, cannot have been reassuring.

With Washington now at his mercy, Cockburn contented himself with destroying public buildings, such as the Capitol, military installations, and the offices of the National Intelligencer, a newspaper that had been regularly abusing him. His ultimate goal was the White House, from which President Madison had fled a few hours before, followed by his wife, Dolley. Cockburn took possession accompanied not only by some of his officers but also by a squad of Colonial Marines — men who only a few months before had been items of property, subject to disposal at the whim of their owners.

The admiral and his party first helped themselves to a dinner ordered by Dolley in expectation of an American victory, and collected souvenirs (Cockburn took the First Lady’s chair cushion, remarking lewdly that it would be a reminder of “her seat”). Then they piled up the furniture and set fire to the building.

Following the subsequent failed attack on Baltimore that inspired Key’s verses, Cockburn moved south to harry the Georgia planters and rescue more slaves, recruiting many of them. The motive for his rescue work clearly went beyond military expediency — he continued to encourage fugitives up to the last days of the war, and indeed into the peace. Despite angry American insistence that the peace treaty mandated the return of all property (i.e., former slaves), Cockburn bluntly refused to hand them over and shipped everyone off to Bermuda. Most eventually settled in Canada, but the Colonial Marines accepted an offer of land in Trinidad. Settled in villages, each under the command of their company sergeants from the old regiment, they were known as the Merikens. Their descendants live there to this day.

Memories of the time when invaders had freed and armed the slaves and brought the republic to the brink of collapse persisted among both slaves and the slave owners who dominated government policy in ensuing decades. Fearful that the threat might one day reappear, the United States commissioned coastal fortifications as a defense against the Royal Navy. One of these was Fort Sumter, ultimately the flash point for the war that ended slavery once and for all. Meanwhile, the Colonial Marines and the significance of their role were gradually eased out of official history. Francis Scott Key, on the other hand, went on to a long career as a powerful crony of President Andrew Jackson, a mentor to Chief Justice Roger Taney of Dred Scott fame, and, as district attorney for the capital, an energetic prosecutor of abolitionists.

In Washington, there are many reminders of that amazing summer of 1814 just beneath the surface, starting with the scorch marks still present under the white paint on the Executive Mansion. Last May, examining a bridge over the Anacostia River in the eastern part of the city, I realized I had found another. The original bridge, a wooden affair, had been burned a few days before the Battle of Bladensburg, thanks to the firm conviction of the American commander, General William Winder, that the admiral and his fearsome force would definitely advance this way. Meanwhile, Cockburn had chosen an unexpected approach from the northeast, so the destruction was for nothing.

Nowadays the modern bridge links two cities. To the west is the new, prosperous Washington, adding residents at a rate of 1,000 per month — most of them young and well-educated, reviving long-neglected neighborhoods, thronging the local restaurants, and propelling a real-estate boom. To the east is Anacostia, comprising Ward Seven and Ward Eight of the District of Columbia. The area is largely poor and overwhelmingly black. Ward Seven has one sit-down restaurant — a Denny’s — and one grocery store. Median household income for families with children in Ward Eight is $26,700, as opposed to a soaring $88,233 for the city overall and its inner suburbs. Most of the 10 percent of Washingtonians trapped in “deep poverty,” defined as 50 percent of the poverty level, live here. So do a large proportion of the city’s 60,000 “returned citizens” — people who have done jail time, and whose felony convictions are a permanent barrier to anything but menial jobs.

The headliners at the event in May that brought me to the bridge, which was being renamed in honor of Ethel Kennedy, were definitely from the well-heeled Washington. Mrs. Kennedy had earned the honor thanks to her years of unpublicized help for people living in these eastern neighborhoods. On hand was an impressive cross section of the local power scene: Mayor Vincent Gray, U.S. Attorney General Eric Holder (who had just helped Gray lose his reelection bid by unveiling a corruption probe), and House Minority Whip Steny Hoyer, as well as a platoon of Kennedys. Guests and speakers gathered under a tent on a greensward beside the river, within sight of a luxuriantly wooded island.

It was a beguilingly pastoral scene. Yet a knowledgeable eye could discern that we were in a poor African-American neighborhood. In the background stood a derelict coal-fired power plant, long slated for demolition, which for generations has been depositing toxic PCBs into the inviting water, now too dangerous for anyone to swim in, let alone eat its fish. The forested island across the river has for years been used as a dumping ground for garbage. Such features are part of a nationwide phenomenon, in which four out of five toxic-waste dumps are in black neighborhoods. (The largest concentration of uncontrolled toxic waste in the United States is on the South Side of Chicago.) “It’s not an accident,” declared Robert Kennedy Jr., the principal speaker at the event, “that this coal-burning power plant was put in this neighborhood.” He also cited the facility’s history of PCB pollution and its “uncontrolled mercury discharge raining down on this community.”

Among those present and paying tribute as grateful beneficiaries of Mrs. Kennedy’s help were current and former members of the Earth Conservation Corps: inner-city teenagers and young adults dedicated to cleaning up the filthy river so that wildlife, including bald eagles and ospreys, might once again nest along its banks. A simple statistic tells much about the lives of its youthful membership. Since the organization’s founding in 1989, twenty-three of them have died — “killed,” as longtime Corps leader Bob Nixon observed to me, by “extreme poverty.” He recalled names. There was, for example, nineteen-year-old Jerome Scott, a budding ornithologist misdiagnosed with mono by the District of Columbia General Hospital and sent home to die suddenly of untreated leukemia, and Diamond Teague, a straight-A student shot for no apparent reason as he sat on his doorstep, and Gerald “Tink” Huelett, stabbed for ten dollars, and Benny Jones, beaten to death with a lead pipe for sitting on the wrong park bench. Almost all the murders remain unsolved.

The 1968 riots — the second burning of Washington — ironically destroyed scores of black-owned businesses while boosting white flight to the suburbs. Then came the crack epidemic, which swept through the capital’s black community in the 1980s and 1990s. “This was a totally different neighborhood when I was growing up,” said David Smith, a Corps veteran, as we toured his home district of Deanwood. “Before crack, people would play ball in the streets, leave their doors unlocked. That all ended with crack. Suddenly everyone had bars on their windows, steel doors. Shootings all the time. It pretty much destroyed the community.”

Crack may have finally receded, but the marijuana laws have helped keep the prisons full — of black people. An ACLU map depicting the location of all D.C.-area marijuana arrests in 2010 makes this strikingly clear. Black neighborhoods were dramatically stippled with dots, while Ward Two, a white neighborhood and home to two major colleges, was a virtual blank. (Earlier this year, the ACLU spearheaded a successful drive to decriminalize marijuana in the district.)

Smith is acutely conscious of the history that is being erased by the march of gentrification, as represented by the formerly black H Street neighborhood, just west of the Kennedy Bridge, with its new streetcar line, bars, restaurants, freshly laid sidewalks, and fancy street lamps. Now its residents are predominantly white. Four years ago, an initiative by the neighborhood council to ban chicken wings in a newly opened 7-Eleven (on grounds that the bones attract rats and choke dogs) fell just a few votes short of passing.

Fueled by the national-security spending and corporate lobbying that followed 9/11, the flood of (mostly white) newcomers to the city appears irreversible. Indeed, Washington’s black community slipped below 50 percent of the population in 2011 for the first time in half a century. Neighborhoods that for years never saw a white face have been transformed almost overnight. As Bob Nixon remarked to me, the “murder line,” a macabre indicator of gentrification, “moves further east every year.” One day soon it may extend all the way into Prince George’s County, Maryland, which thirty years ago was poor, white, and festooned with Confederate flags, and today has a black majority.

Smith took me on a tour of his Washington, one that is fast disappearing. Heading east on the freeway, we passed Nationals Park, a showcase of the city’s transformation. The imposing stadium, home to the Washington Nationals baseball team, opened in 2008 in what was formerly the poverty-stricken and crime-ridden Navy Yard district. “They moved people out when they started building, but told them they could come back when the place was rebuilt,” Smith remarked as we sped by. “But you had to be creditworthy and earn ninety-thousand dollars a year. So very few ever came back.”

Nowadays Navy Yard is everything a developer or city official could desire: $500,000 condos, a Marriott hotel, an enviable corporate address just a few blocks from the Capitol. The old community has largely dispersed, although no one could tell me exactly where they had gone. Laneisha McCauley, a high school student from one of the few families that did return, wrote a prizewinning essay a few years ago recalling her lost neighborhood, where “African American children crammed the sidewalks playing Double Dutch” and there was always “a hand outstretched to reach mine.”

Moving east of the river and down into Ward Eight, we surveyed Barry Farm, a district built for freedmen following the Civil War, generating profits that financed nearby Howard University. Now the area is run-down, partly abandoned, and a target for developers. We passed the sprawling, half-built complex destined to be a multibillion-dollar headquarters for the Department of Homeland Security, billed as a pump primer for the Ward Eight economy. Gesturing at the high walls, Smith observed that almost all the jobs would be reserved for college graduates with security clearances — not much of a prospect for returned citizens, or for almost anyone else from the neighborhood.

Eventually we picked up Reverend Edwin Jones of the Living Faith Baptist Church. Like Smith, the pastor lamented that young African Americans in Washington have little sense of their community’s rich history. How many would even know that Nannie Helen Burroughs Avenue, the street running past Jones’s church, is named for a trailblazing civil rights activist?

Together we drove over to Woodlawn Cemetery, the final stop on our tour. Spread over twenty-two acres of rolling hillside, it’s a picturesque, even romantic spot. Yet many headstones of Reconstruction-era black senators, congressmen, and writers have been vandalized or semi-obscured by grass and weeds, which the pastor and other volunteers have been laboriously beating back.

Smith, who comes from a family with profound ties to the civil rights struggle over five generations, is himself focused on memorializing another historical episode — a spectacular slave escape — which he believes can serve as an inspiration to young people in his community. More than three decades after the Colonial Marines stormed into the capital, local abolitionists hatched a plan to publicize the ongoing role of Washington as a major center for the slave trade. Among the planners was Paul Jennings, formerly James Madison’s enslaved valet, who had fled the White House in 1814 just ahead of Cockburn’s forces. By 1848, having recently bought his freedom from a reluctant Dolley, he was working as a butler for the powerful Senator Daniel Webster and was deeply involved in the Underground Railroad.

On the night of April 15, seventy-seven men and women slipped away from the houses of their masters. (One of them, fifteen-year-old Mary Ellen Stewart, was the property of Dolley Madison.) They made their way to the Pearl, a sixty-five-foot schooner hired by Jennings and his fellow conspirators, which was moored at the Seventh Street Wharf. Once loaded, the ship moved down the Potomac, headed for the Chesapeake and ultimately New Jersey, a free state.

Tragically, the wind turned against them and they had to anchor for the night at Point Lookout, Maryland, where the river empties into the bay. In the meantime, a party of infuriated owners, having awakened to find their slaves gone, set off in a steamboat, catching up to the Pearl at Point Lookout. The fugitives were brought back and handed over to slave traders, who speedily split them up and sold most of them to plantations in the deep South. (A fortunate few, including Stewart, were eventually bought by antislavery activists and set free.)

In its immediate goal, then, the scheme was a failure. Nevertheless, it did succeed in its wider purpose — within two years, the slave trade (if not slavery itself) would be outlawed in Washington. The incident also galvanized public opinion throughout the country, and ultimately inspired Harriet Beecher Stowe to write Uncle Tom’s Cabin.

Smith is executive director of the nonprofit Pearl Coalition, which is building a replica of the original schooner. His hope is that the boat, and the history it represents, will continue to have a galvanizing effect. “The Pearl is important for the young because it connects them with a forgotten past, and their responsibility to see that history does not repeat itself,” he told me. At the very least, the Pearl can serve as a counterpoint to Francis Scott Key’s eponymous memorial, Key Bridge, which spans the Potomac far upriver from Anacostia. A plaque at the Georgetown end hails Key, the prosecutor of abolitionists and the aspiring scourge of runaway slaves, as “active in antislavery causes.” As far as history goes, it doesn’t get much rosier than that.