When Confederate General Robert E. Lee launched his invasion of Maryland in September 1862, McClellan's Army of the Potomac (of which IX Corps was part) was sent in chase. At the Battle of South Mountain on September 14, Welsh, now in brigade command, engaged the rebels at Fox's Gap. His brigade came under heavy fire and suffered severe casualties, but succeeded in driving the Confederates off the ridge and securing a Union victory.