The U. S. Navy traces its origins to the Continental Navy, which was established during the American Revolutionary War and was effectively disbanded as a separate entity shortly thereafter. After suffering significant loss of goods and personnel at the hands of the Barbary pirates from Algiers, the U. S. Congress passed the Naval Act of 1794 for the construction of six heavy frigates, the first ships of the U. S. Navy. The U. S. Navy played a major role in the American Civil War by blockading the Confederacy and seizing control of its rivers. It played the central role in the World War II defeat of Imperial Japan. The U. S. Navy emerged from World War II as the most powerful navy in the world. The 21st century U. S. Navy maintains a sizable global presence, deploying in strength in such areas as the Western Pacific, the Mediterranean, and the Indian Ocean. It is a blue-water navy with the ability to project force onto the littoral regions of the world, engage in forward deployments during peacetime and rapidly respond to regional crises, making it a frequent actor in U. S. foreign and military policy.