The Battle of Gaines' Mill waged east of Mechanicsville was the third of the Seven Days Battles. At first, Garland and his men had to survive artillery fire while waiting out for the enemy in rifle pits on Williamsburg Road as Garland and his troops were assigned to support Generals Lewis Armistead and Ambrose R. Wright forces. At about 2 a.m. they began moving on the enemy. They stopped and hid at a position on the Mechanicsville turnpike just behind the crest of the commanding hill and waited there for Maj. Gen. A. P. Hill to attack the other side of Mechanicsville. Garland and his troops were hit with heavy artillery fire from Beaver Dam Creek. Eventually, the afternoon rolled around and Gen. Hill arrived and began to attack the Federals from the other side. They were then given orders to advance, but they first had to defeat the enemy at Beaver Creek Dam before they could move through. The Federals had artillery and a small amount of infantry so Garland's troops attacked until the Federals retreated. This happened early on the 27th of June. Garland's men then advanced to their next positions, but before they could arrive they ran into the Federal troops at New Cold Harbor. The battle raged on for some time. Soon Maj. Gen. Stonewall Jackson arrived and began rearranging the formations of the troops. Then Garland along with a couple other battalions crossed an open field into the woods. Here they found an exposed enemy flank and began preparing to attack it. As soon as Gen. Hill joined up with them they commenced the attack on the exposed enemy flank. The Federals quickly gave up and began to flee. At one point they attempted a second stand, but even this was broken quickly as Garland and his men had momentum on their side. This ended the battle with a victory for Garland and the Confederates. In the Battle of Gaines' Mill, Garland successfully attacked the Federal flank and took many prisoners earning an outstanding reputation in the Confederate army.