From its inception during the American Revolutionary War, the U.S. Armed Forces have played a decisive role in the history of the United States. It helped forge a sense of national unity and identity through its victories in the First Barbary War and the Second Barbary War. It played a critical role in the American Civil War, keeping the Confederacy from seceding from the republic. The National Security Act of 1947, adopted following World War II, created the modern U.S. military framework. The Act established the National Military Establishment, headed by the secretary of defense; and created the United States Air Force and the National Security Council. It was amended in 1949, renaming the National Military Establishment the Department of Defense, and merged the cabinet-level Department of the Army, Department of the Navy, and Department of the Air Force, into the Department of Defense.