During the American Civil War, Philadelphia was an important source of troops, money, weapons, medical care, and supplies for the Union.
Before the Civil War, Philadelphia's economic connections with the South made much of the city sympathetic to South's grievances with the North. Once the war began, many Philadelphians' opinion shifted in support for the Union and the war against the Confederate States. More than 50 infantry and cavalry regiments were recruited fully or partly in Philadelphia. The city, the main source for uniforms for the Union Army, also manufactured weapons and built warships. Philadelphia also had the two largest military hospitals in the United States: Satterlee Hospital and Mower Hospital.
In 1863, Philadelphia was threatened by Confederate invasion during the Gettysburg Campaign. Entrenchments were built to defend the city, but the Confederate Army was turned back at Wrightsville, Pennsylvania, and at the Battle of Gettysburg. The Civil War's main legacy in Philadelphia was the rise of the Republican Party. Despised before the war because of its anti-slavery position, the party created a political machine that would dominate Philadelphia politics for almost a century.