Bomb-proof quarters in Fort Sedgwick in front of Petersburg, Va. Quarters of men in Fort Sedgwick, generally known as "Fort Hell". (Library of Congress Prints and Photographs Division Washington, D.C.)

Forty-one white headstones form two concentric circles around an American flag in the tiny graveyard that is tucked into the middle of a block on Georgia Avenue in Northwest Washington.

The two six-pound smoothbore guns guarding the entrance of Battleground National Cemetery seem out of place amid the surrounding apartment buildings. The immaculate one-acre plot, one of the country’s smallest national cemeteries, draws scant attention from cars whizzing by, perhaps fitting for a little-remembered Civil War episode.

Yet 150 years ago, the fate of the capital, and, some feared, the Union, hung on the men defending Washington during the third and final Confederate invasion of the North. The soldiers laid to rest there died protecting the northernmost of Washington’s fortifications, Fort Stevens (from the cemetery, go six blocks south on Georgia and take a right at the Wonder Chicken.)

That fight was the culmination of a series of battles and engagements along a Confederate line of advance that cut through towns and neighborhoods that today are at or near the heart of the Washington region, including Frederick, Gaithersburg, Rockville, Bethesda, Takoma Park, Silver Spring, and, most critically, Monocacy Junction.

Twice before, Gen. Robert E. Lee had sent the Army of Northern Virginia on invasions of the North, and twice he had been forced to retreat. Lee’s first invasion, in September 1862, led to the single bloodiest day in American history, at Antietam, where the Confederates were turned back but escaped to Virginia. Less than a year later, Lee crossed the Potomac River again, culminating in the fateful Confederate defeat at Gettysburg in July 1863.

Gen. Lew Wallace (Library of Congress Prints and Photographs Division Washington, D.C.)

Lee was a risk-taker, and in the summer of 1864, he was ready to gamble again. Lt. Gen. Ulysses S. Grant’s relentless Army of the Potomac had backed the Confederates into battle lines protecting Richmond and Petersburg, and it appeared poised for a drive to capture the Southern capital.

On June 12, Lee entrusted Lt. Gen. Jubal A. Early, one of his most aggressive and experienced commanders, with a bold mission intended to relieve pressure on the Confederate defenders. Lee would send his 2nd Corps under Early — a major portion of his army — to clear out a Union force that had taken possession of much of the Shenandoah Valley. If he saw an opening, Early was to invade Maryland, disrupt Union rail and communication lines, and threaten Washington.

Lee was fond of Early — “my bad old man,” as he called the cantankerous and blunt commander. Early, a West Point graduate who practiced law in Rocky Mount, Va., had vigorously opposed secession but took up arms when war was declared. Lee had grown to rely on “Old Jube,” particularly with the death of Maj. Gen. Thomas “Stonewall” Jackson at Chancellorsville the previous year.

Early and his men — many of them tough veterans of Jackson’s 1862 Shenandoah campaign — took to the mission with verve. Little more than the sight of the Confederate force at Lynchburg on June 18 was enough to send Union Maj. Gen. David Hunter and his larger force skedaddling to Charleston, W.Va.

Compounding Hunter’s wretched performance was his failure to alert the Union high command that he would be unable to cut off Early’s advance. Grant — who believed Early’s corps was still at Petersburg — was left blind to a great and sudden danger.

“Nothing blue stood between Early and the Potomac,” historian Shelby Foote wrote.

The rebels moved northeast at a rapid clip beginning June 23, passing through Lexington, where the men marched past Jackson’s grave, baring their heads in silent salute. They reached New Market on June 30, and Winchester July 2. Bolstered by reinforcements, their numbers reached 16,000.

Jubal A. Early, between 1860 and 1880. (Library of Congress Prints and Photographs Division Washington, D.C.)

On July 4, the nation’s 88th birthday, Early’s army reached the Potomac, celebrating with raucous feasts on Yankee provisions captured at Martinsburg and Harpers Ferry, including sardines, oysters and plenty of liquor. The third invasion of the North was underway.

The idea of Washington falling to an enemy army may seem almost impossible today, but it did not seem at all implausible to residents in 1864. Just fifty years earlier, within the lifetime of old-timers, a bold British force had captured the capital, burning the White House and the Capitol.

After the overwhelming Confederate victory at First Manassas in 1861, Washington had panicked when it seemed the rebels might take the capital.

In the three years since, the Union had constructed an elaborate network of defenses around the capital, including a 37-mile-long circle of 68 forts, connected by miles of rifle pits and trenches. But the best troops manning the fortifications had been stripped away to bolster Grant’s force, leaving the capital vulnerable.

By July 5, Union commanders belatedly recognized that Early posed a formidable threat. Grant reluctantly agreed to send one Sixth Corps division north, but no more, still believing that Hunter could protect the capital.

The task of slowing the Confederates would fall to Maj. Gen. Lew Wallace, a Union commander in semi-disgrace since Grant blamed him for arriving late with his forces at the bloody Battle of Shiloh in Tennessee in April 1862. Wallace had been assigned in 1864 to command the Middle Atlantic Department in Baltimore, something of a backwater.

But Wallace did not lack for confidence. Warned by Baltimore and Ohio Railroad President John Garrett that the Confederates were moving into Maryland in force, Wallace acted to fill the Union vacuum.

He concluded that Monocacy Junction south of Frederick — where roads from Baltimore and Washington as well as the B&O railroad converged — would be key to his defense. Without orders, Wallace left Baltimore and assembled a force of 3,200 men from his command, the majority of them ill-trained “100-Days Men” who had been recruited for rear-guard duty.

The pace of Early’s advance had slowed, in part because of undisciplined Confederate looting. But from Frederick on the afternoon of July 8, Wallace could see three long Confederate columns of infantry and artillery “crawling serpent-like” toward the city.

Wallace abandoned Frederick to make his stand along the banks of the Monocacy River. Early was in the city by 8 a.m., negotiating a $200,000 payment to Confederate coffers from city fathers to spare Frederick from the torch.

The morning of July 9 “dawned with a halo on sunshine and beauty,” a soldier from Ohio recalled. In the nick of time, Wallace was bolstered by the arrival of 3,400 veteran troops sent by Grant from Richmond via steamer and train, doubling the Union force.

Early hoped to avoid a major battle, preferring to preserve his force for a move on the capital. But the Confederates advancing from Frederick along Georgetown Pike — today Route 355 — were soon drawn into a fight, apparently unaware that a road leading to Buckeystown would have skirted Wallace’s defenses.

Seeking to avoid a frontal attack, Confederate cavalry dismounted and crossed the river downstream near the Worthington Farm. But Union soldiers positioned along a fence at the adjoining Thomas Farm fired what Wallace described as a “pitiless rain” of bullets at the invaders, knocking them back.

A second Confederate attack succeeded in taking the Thomas Farm, but a determined federal counterattack pushed the rebels back to the Worthington Farm.

Late that afternoon, Confederate Maj. Gen John Brown Gordon launched a third assault with a division of Georgians, Louisianans and Virginians backed by artillery. The attack — across land today within Monocacy National Battlefield but split by Interstate 270 — was as fierce as any seen by many of the men, among them veterans of Gettysburg and Antietam. With his force on the verge of annihilation, Wallace retreated.

It was a decisive rebel victory — a rout, even, by some Confederate descriptions — but it had come with a heavy price, and not only the 900 Confederate casualties. The Union troops, at the cost of 1,300 casualties, had delayed Early’s attack on Washington by an entire day — critical time, it would turn out.

(Following the defeat, Wallace was relieved of command, but after learning details of the brave Union stand at Monocacy, Grant had him reinstated. Wallace would achieve lasting fame for his novel “Ben-Hur,” published in 1880.)

After camping on the battlefield, the exhausted Confederates resumed their march to Washington on Sunday morning, July 10, but they made limited progress in beastly heat. That night they camped spread out between Gaithersburg and Rockville.

At Lee’s behest, Early dispatched cavalry dashing across the state to free thousands of Confederate prisoners held at Point Lookout, where the Potomac empties into the Chesapeake Bay. The mission was ultimately aborted, but not before cavalry wreaked havoc between Baltimore and Washington, looting and cutting communications.

In Washington, worries were growing about the city’s defenses, manned primarily by 100-Days Men, recuperating wounded soldiers, and even — as the Confederates advanced — government clerks. “We have five times as many generals here as we want but are greatly in need of privates,” complained Maj. Gen. Henry Halleck, Grant’s chief of staff.

Within hours of the Union defeat at Monocacy, Grant ordered two more Sixth Corps divisions to board transports and sail immediately for Washington.

From Rockville on Monday morning, Early’s army took what is now Veirs Mill Road into Wheaton — then called Leesborough — and turned south onto the Seventh Street Pike, now known as Georgia Avenue, according to histories by B.F. Cooling and Marc Leepson. Some cavalry took a different route, down what is now Old Georgetown Road and Wisconsin Avenue toward Fort Reno near Tenleytown.

By noon, Early was in the District within sight of Fort Stevens. Many of the Confederates were eager to take revenge on the “vile miscreants living there,” Pvt. William Stringfellows of North Carolina wrote in his diary. But Early decided that his bedraggled force, spread out for miles behind him, was in no condition yet to attack.

The Confederates probed the defenses, moving through a landscape then consisting of farms and orchards, and skirmished sharply with federal troops. From Fort Stevens and Fort DeRussy — where joggers now run past remaining earthworks in the wooded hills of Rock Creek Park — Union batteries hammered at the invaders.

Even as more Confederates moved down Seventh Street, more Sixth Corps troops had arrived by steamboat at the Washington wharf and were marching up the same road from the opposite direction, cheered by jubilant crowds.

The unmistakable long and lanky figure of Lincoln appeared on the Fort Stevens parapet at least once during the fighting, and when fire from Confederate sharpshooters zeroed in, Union officers — but probably not, despite the oft-repeated claim, Capt. Oliver Wendell Holmes Jr., the future Supreme Court Justice — called in strong language for the president to get down.

Early made his headquarters that evening in Maryland near the District line at Silver Spring, in the long-since-demolished mansion belonging to the Blair family that would give the surrounding community its name. Over cigars and wine from the Blair cellar, Old Jube and his commanders contemplated their next step.

The next morning, July 12, Early reconnoitered the lines and concluded that with the arrival of Union reinforcements, an attack would be foolhardy. The Confederates waited until nightfall to retreat, leading to a brief but violent fight when a Union brigade surged toward Confederate lines.

“We haven’t taken Washington, but we scared Abe Lincoln like hell,” Early told an aide.

Lincoln may not have been scared, but Early and Lee had accomplished a great deal. They had recovered the Shenandoah Valley in time for the harvest and captured thousands of horses and cattle in Maryland. Most importantly, they had forced Grant to shift two corps north, relieving pressure on the Confederate capital and delaying Union hopes of victory.

Early had come closer than Grant to capturing the enemy capital.

Early’s retreating army passed through Rockville and continued west through Poolesville, well ahead of a half-hearted federal pursuit. On the morning of July 14, the rebels crossed the Potomac at White’s Ford to Leesburg and headed west to the Shenandoah Valley, ending the last Confederate invasion.

Today, just upriver, at White’s Ferry, a barge by the name of Jubal Early carries commuters across the dark waters of the Potomac, time and time again.

Steve Vogel is the author of Through the Perilous Fight: From the Burning of Washington to the Star-Spangled Banner, the Six Weeks That Saved the Nation

Sources: B.F. Cooling, “Jubal Early’s Raid on Washington”; Marc Leepson, “Desperate Engagement”; Shelby Foote, “The Civil War”; Margaret Leech, “Reveille in Washington”; National Park Service.