Although Stoneman's Union cavalry did destroy the railroads, the onslaught on Macon failed from the beginning and on 31 July 1864, Keogh and Stoneman's command were surrounded during the Battle of Sunshine Church, Georgia. They were captured after both their horses were shot out from under them. Keogh was held for 2½ months as a prisoner of war before being released through Union general William Tecumseh Sherman's efforts. Keogh would later receive a second brevet with promotion to lieutenant colonel for his gallantry with Stoneman at the Battle of Dallas.