The complexion of the war changed as the election approached. Confederate Commander Robert E. Lee's last victory in battle occurred June 3, 1864 at Cold Harbor. Union General Ulysses S. Grant's aggressive tactics trapped Lee in the trenches defending Richmond. Admiral David Farragut successfully shut down Mobile Bay as a Confederate resource in the Battle of Mobile Bay on August 3–23, 1864. Most decisive of all, Union General William Tecumseh Sherman captured Atlanta on September 1, 1864, convincing even the pessimists that the Confederacy was collapsing.