After pursuing the Confederate general Robert E. Lee into Maryland, Maj. Gen. George B. McClellan of the Union Army launched attacks against Lee's army, in defensive positions behind Antietam Creek. At dawn on September 17, Maj. Gen. Joseph Hooker's corps mounted a powerful assault on Lee's left flank. Attacks and counterattacks swept across Miller's Cornfield, and fighting swirled around the Dunker Church. Union assaults against the Sunken Road eventually pierced the Confederate center, but the Federal advantage was not followed up. In the afternoon, Union Maj. Gen. Ambrose Burnside's corps entered the action, capturing a stone bridge over Antietam Creek and advancing against the Confederate right. At a crucial moment, Confederate Maj. Gen. A. P. Hill's division arrived from Harpers Ferry and launched a surprise counterattack, driving back Burnside and ending the battle. Although outnumbered two-to-one, Lee committed his entire force, while McClellan sent in less than three-quarters of his army, enabling Lee to fight the Federals to a standstill. During the night, both armies consolidated their lines. In spite of crippling casualties, Lee continued to skirmish with McClellan throughout September 18, while removing his battered army south of the Potomac River.