Between 1776 and 1789, the United States became an independent country, creating and ratifying its new constitution, and establishing the federal government. In an attempt to gain autonomous status within the British Empire, American Revolutionaries implemented nonviolent means of protest which quickly grew into a political revolution followed by a war for independence to defend it. The Americans eventually won the war, declaring the United States a sovereign nation in the interim. After thirteen years of relatively loose Confederation, the U.S. government, fearing foreign invasion and domestic insurrection, replaced the governing Articles of Confederation to strengthen the federal government's powers of defense and taxation with the Constitution of the United States in 1789, still in effect today.