When Lee decided to invade the North in the Maryland Campaign, Jackson took Harpers Ferry, then hastened to join the rest of the army at Sharpsburg, Maryland, where they fought McClellan in the Battle of Antietam (Sharpsburg). Antietam was primarily a defensive battle against superior odds, although McClellan failed to exploit his advantage. Jackson's men bore the brunt of the initial attacks on the northern end of the battlefield and, at the end of the day, successfully resisted a breakthrough on the southern end when Jackson's subordinate, Maj. Gen. A. P. Hill, arrived at the last minute from Harpers Ferry. The Confederate forces held their position, but the battle was extremely bloody for both sides, and Lee withdrew the Army of Northern Virginia back across the Potomac River, ending the invasion. On October 10, Jackson was promoted to lieutenant general, being ranked just behind Lee and Longstreet and his command was redesignated the Second Corps.