During the third Confederate invasion of the North in July 1864, B&amp;O agents began reporting Confederate troop movements in western Virginia, the Shenandoah Valley and through Frederick, Maryland under General Jubal Early eleven days prior to what became the critical Battle of the Monocacy. Garrett had their intelligence passed to the U.S. War Department, particularly to Major General Lew Wallace (later noted author of the historical novel "Ben Hur"), who commanded the department responsible for defense of the area surrounding the national capitol. As battle preparations progressed, Garrett provided transport for Federal troops and munitions, and on two occasions President Lincoln contacted him directly for further information. Though Union forces lost this battle, the two-day delay allowed General Ulysses S. Grant, then campaigning further south and threatening the Confederate capital, Richmond and nearby Petersburg to detach several Federal regiments from his substantial forces and send them up north on the Chesapeake Bay and Potomac River. They two days later thus repelled the Gen. Early's attack on Washington at the Battle of Fort Stevens on the capital's northwestern outskirts of the capital. After the battle, President Lincoln commended Garrett as "The right arm of the Federal Government in the aid he rendered the authorities in preventing the Confederates from seizing Washington and securing its retention as the Capital of the Loyal States."