The command of what was now called the XI Corps changed to Maj. Gen. Oliver O. Howard in 1863, and Steinwehr continued to command the division in the Battle of Chancellorsville and the Battle of Gettysburg. The corps was the victim of the surprise flanking attack by Stonewall Jackson at Chancellorsville on May 2, 1863, and the overwhelming attack by Lt. Gen. Richard S. Ewell's Second Corps on the first day of Gettysburg, July 1, 1863. At Chancellorsville, Steinwehr's division had one brigade, that of Col Adolphus Buschbeck involved in resisting Jackson's attack. At Gettysburg, when the corps was forced to retreat back through the town to Cemetery Hill, Col Charles Coster took a brigade of Steinwehr's division out to the edge of the town, where it sacrificed itself buying time for the retreating soldiers of the other two divisions. These two defeats seriously degraded the combat effectiveness of the XI Corps and humiliated many of the German immigrant soldiers in the corps. Nevertheless, Steinwehr was well thought of by his superiors. After Chancellorsville, General Howard wrote that Steinwehr's bearing during the battle was "cool, collected and judicious." Brig. Gen. Alpheus Williams, a fellow division commander, described him as a "remarkably intelligent and agreeable person."