Lee then turned northward to deal with the Union Army of Virginia, commanded by Major General John Pope, planning to defeat Pope's army before it could unite with McClellan's army, which was arriving in northern Virginia from the Peninsula. During the Second Battle of Bull Run, Lee routed Pope's army and then invaded Maryland, hoping to seize supplies from Union territory and also hoping that a major Confederate victory in Northern territory would secure foreign recognition for the Confederacy. However, McClellan attacked Lee through the passes of South Mountain and forced Lee to call off his planned invasion of Pennsylvania, instead concentrating his army behind Antietam Creek. Neither army gained a victory at the Battle of Antietam on September 17, but Lee's retreat back to Virginia gave the Union a strategic victory in the campaign. During October and November, Union President Abraham Lincoln pressured McClellan to launch an aggressive campaign against Lee but McClellan refused, instead moving slowly and demanding supplies. Lincoln replaced McClellan on November 7 with Major General Ambrose Burnside, who hoped to cross the Rappahannock River near Fredericksburg, Virginia in order to get between Lee and Richmond. However, delays in obtaining a pontoon bridge prevented Burnside from crossing the river until December 11, by which time Lee was able to concentrate his entire army along a series of ridges near Fredericksburg. On December 13, Burnside attacked the Confederate positions and lost heavily; two days later he retreated back across the river and went into winter quarters.