At the beginning of the Gettysburg Campaign, on June 9, 1863, Kilpatrick fought at Brandy Station, the largest cavalry battle of the war. He received his brigadier general's star at the age of 27 on June 13, fought at Aldie and Upperville, and assumed division command three days before the Battle of Gettysburg commenced. On June 21, he was captured at Upperville, but was quickly rescued, going on to risk his life that same day in order to rescue the wounded commander of the 5th North Carolina Cavalry. On June 30, he clashed briefly with J.E.B. Stuart's cavalry at Hanover, Pennsylvania, but then proceeded on a wild goose chase in pursuit of Stuart, rather than fulfilling his mission of intelligence gathering.