West Virginia became a state when it seceded from Virginia (a Confederate state) during the Civil War. The constitutionality of its formation was challenged by the Virginia General Assembly but was eventually decided in favor of West Virginia by the U.S. Supreme Court in 1870. The Supreme Court later ruled ruled that West Virginia owed Virginia $12.3 million as its share of pre-war Virginia's debts, and this obligation was finally paid off in 1939.