The regiment was mustered into service at Camp Curtin between August 6 and 10, after which it was ordered to Northern Virginia.
While encamped near the battlefield in the weeks afterward, the 126th received its regimental flags and was reviewed by President Abraham Lincoln.
At the Battle of Chancellorsville on May 2, 1863, the division remained on the Union left flank near the Rappahannock River.
After two hours of fighting and subsequently running out of ammunition, the 126th was forced to retreat to the protection of artillery.
Shortly afterwards, the regiment was ordered back to Harrisburg, Pennsylvania, where it was mustered out on May 20, 1863.