toward Lynchburg, tearing up railroad track as they advanced. Hunter believed the troops at Lynchburg were too powerful, however, and the brigade returned to West Virginia. Before the army could make another attempt, Confederate General Jubal Early's raid into Maryland forced their recall to the north. Early's army surprised them at Kernstown on July 24, where McKinley came under heavy fire and the army was defeated. Retreating into Maryland, the army was reorganized again: Major General Philip Sheridan replaced Hunter, and McKinley, who had been promoted to captain after the battle, was transferred to General Crook's staff. By August, Early was retreating south in the valley, with Sheridan's army in pursuit. They fended off a Confederate assault at Berryville, where McKinley had a horse shot out from under him, and advanced to Opequon Creek, where they broke the enemy lines and pursued them farther south. They followed up the victory with another at Fisher's Hill on September 22 and were engaged once more at Cedar Creek on October 19. After initially falling back from the Confederate advance, McKinley helped to rally the troops and turn the tide of the battle. After Cedar Creek, the army stayed in the vicinity through election day, when McKinley cast his first presidential ballot, for the incumbent Republican, Abraham Lincoln. The next day, they moved north up the valley into winter quarters near Kernstown. In February 1865, Crook was captured by Confederate raiders. Crook's capture added to the confusion as the army was reorganized for the spring campaign, and McKinley served on the staffs of four different generals over the next fifteen days—Crook, John D. Stevenson, Samuel S. Carroll, and Winfield S. Hancock. Finally assigned to Carroll's staff again, McKinley acted as the general's first and only adjutant. Lee and his army surrendered to General Ulysses S. Grant a few days later, effectively ending the war. McKinley joined a Freemason lodge (later renamed after him) in Winchester, Virginia, before he and Carroll were transferred to Hancock's First Veterans Corps in Washington. Just before the war's end, McKinley received his final promotion, a brevet commission as major. In July, the Veterans Corps was mustered out of service, and McKinley and Carroll were relieved of their duties. Carroll and Hancock encouraged McKinley to apply for a place in the peacetime army, but he declined and returned to Ohio the following month. McKinley, along with Samuel M. Taylor