Since 1848 the Swiss Confederation has been a federal republic of relatively autonomous cantons, some of which have a history of federation that goes back more than 700 years, putting them among the world's oldest surviving republics. The early history of the region is tied to that of Alpine culture. Switzerland was inhabited by the Helvetii, and it came under Roman rule in the 1st century BC. The Gallo-Roman culture was amalgamated with Germanic influence during Late Antiquity, with the eastern part of Switzerland becoming Alemannic territory. The area of Switzerland was incorporated into the Frankish Empire in the 6th century. In the High Middle Ages, the eastern part became part of the Duchy of Swabia within the Holy Roman Empire, while the western part was part of Burgundy. The Old Swiss Confederacy in the Late Middle Ages (the Eight Cantons) established its independence from the House of Habsburg and the Duchy of Burgundy, and in the Italian Wars gained territory south of the Alps from the Duchy of Milan. The Swiss Reformation divided the Confederacy and resulted in a drawn-out history of internal strife between the Thirteen Cantons in the Early Modern period. In the wake of the French Revolution, Switzerland fell to a French invasion in 1798 and was reformed into the Helvetic Republic, a French client state. Napoleon's Act of Mediation in 1803 restored the status of Switzerland as a Confederation, and after the end of the Napoleonic period, the Swiss Confederation underwent a period of turmoil culminating in a brief civil war in 1847 and the creation of a federal constitution in 1848. The history of Switzerland since 1848 has been largely one of success and prosperity. Industrialisation transformed the traditional agricultural economy, and Swiss neutrality during the World Wars and the success of the banking industry furthered the ascent of Switzerland to its status as one of the world's most stable economies. Switzerland signed a free-trade agreement with the European Economic Community in 1972 and has participated in the process of European integration by way of bilateral treaties, but it has notably resisted full accession to the European Union (EU) even though its territory almost completely (except for the microstate Liechtenstein) has been surrounded by EU member states since 1995. In 2002, Switzerland joined the United Nations. Early history Prehistory Archeological evidence suggests that hunter-gatherers were already settled in the lowlands north of the Alps