In 1862, McGuire was promoted to the chief surgeon of Jackson's Corps, serving in the Army of Northern Virginia under its Medical Director, Dr. Lafayette Guild. While attached to Jackson's corps during the Second Bull Run Campaign, McGuire amputated Jackson's subordinate Richard Ewell's leg after Ewell was wounded at the Battle of Groveton. In May 1863, Jackson was gravely wounded by friendly fire while performing a reconnaissance during the Battle of Chancellorsville. The severity of the wounds required Dr. McGuire to amputate Jackson's left arm. Jackson died of pneumonia a few days later. His last words were recorded by Dr. McGuire as: "Let us cross over the river and rest beneath the shade of the trees". The death of Jackson affected McGuire greatly. He would always remember Jackson with the deepest reverence and served as a pallbearer in Stonewall's funeral.