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 German-speaking part belonged to the Duchy of Swabia within the Holy Roman Empire, while the western French-speaking 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 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 in the Middle Paleolithic period 150,000 years ago. Agriculture in Switzerland began around 5500 BC.

By the Neolithic period, the area was relatively densely populated. Remains of Bronze Age pile dwellings from as early as 3800 BC have been found in the shallow areas of many lakes. Around 1500 BC, Celtic tribes settled in the area. The Raetians lived in the eastern regions, while the west was occupied by the Helvetii.

Antiquity

In 58 BC, the Helvetii tried to evade migratory pressure from Germanic tribes by moving into Gaul, but were defeated by Julius Caesar's armies and then sent back. The alpine region became integrated into the Roman Empire and was extensively romanized in the course of the following centuries. The center of Roman administration was at Aventicum (Avenches). In 259, Alamanni tribes overran the Limes, putting the settlements on Swiss territory on the frontier of the Roman Empire.

The first Christian bishoprics were founded in the fourth century.

With the fall of the Western Roman Empire, Germanic tribes entered the area. Burgundians settled in the west; while in the north, Alamanni settlers slowly forced the earlier Celto-Roman population to retreat into the mountains. Burgundy became a part of the kingdom of the Franks in 534; three years later, the dukedom of the Alamans followed suit. In the Alaman-controlled region, only isolated Christian communities continued to exist and Irish monks re-introduced the Christian faith in the early 7th century.

Medieval period

Under the Carolingian kings, the feudal system proliferated, and monasteries and bishoprics were important bases for maintaining the rule. The Treaty of Verdun of 843 assigned Upper Burgundy (the western part of what is today Switzerland) to Lotharingia, and Alemannia (the eastern part) to the eastern kingdom of Louis the German which would become part of the Holy Roman Empire.

In the 10th century, as the rule of the Carolingians waned, The Arabs from Fraxinetum invaded many Swiss cities, controlled the entire Swiss Alps, and their incursions reached as far as St. Gallen in northern Switzerland and southern Germany. Magyars destroyed Basel in 917 and St. Gallen in 926. Only after the victory of King Otto I over the Magyars in 955 in the Battle of Lechfeld, were the Swiss territories reintegrated into the empire.

In the 12th century, the dukes of Zähringen were given authority over part of the Burgundy territories which covered the western part of modern Switzerland. They founded many cities, including Fribourg in 1157, and Bern in 1191. The Zähringer dynasty ended with the death of Berchtold V in 1218, and their cities subsequently became reichsfrei (essentially a city-state within the Holy Roman Empire), while the dukes of Kyburg competed with the house of Habsburg over control of the rural regions of the former Zähringer territory.

Under the Hohenstaufen rule, the alpine passes in Raetia and the St Gotthard Pass gained importance. The latter especially became an important direct route through the mountains. Uri (in 1231) and Schwyz (in 1240) were accorded the Reichsfreiheit to grant the empire direct control over the mountain pass. Most of the territory of Unterwalden at this time belonged to monasteries that had previously become reichsfrei.

The extinction of the Kyburg dynasty paved the way for the Habsburg dynasty to bring much of the territory south of the Rhine under their control, aiding their rise to power. Rudolph of Habsburg, who became King of Germany in 1273, effectively revoked the status of Reichsfreiheit granted to the "Forest Cantons" of Uri, Schwyz, and Unterwalden. The Forest Cantons thus lost their independent status and were governed by reeves.

Old Confederacy (1300–1798)

Late Medieval period

On 1 August 1291, the cantons of Uri, Schwyz, and Unterwalden united to defend the peace upon the death of Emperor Rudolf I of Habsburg, forming the nucleus of the Old Swiss Confederacy.

By 1353, the three original cantons had been joined by the cantons of Glarus and Zug and the city-states of Lucerne, Zürich, and Bern, forming the "Old Federation" of eight states that persisted during much of the 15th century. The Holy Roman Empire built roads and bridges to connect the industrial region of north Italy with the Rhine (linked with the other industrial area of Middle Age Europe, the Burgundian Netherlands), making the peasants and bankers on the road rich, allowing them to buy specialized Italian armor and to stop paying the road collecting taxes to the Empire who built the road. At the Battle of Sempach in 1386, the Swiss defeated the Habsburgs, gaining increased autonomy within the Holy Roman Empire.

Zürich was expelled from the Confederation from 1440 to 1450 due to a conflict over the territory of Toggenburg (the Old Zürich War). The Confederation's power and wealth increased significantly, with victories over Charles the Bold of Burgundy during the Burgundian Wars (1474–1477), greatly due to the success of the Swiss mercenaries, a powerful infantry force constituted by professional soldiers originally from the cantons of the Old Swiss Confederacy. They were notable for their service in foreign armies, especially among the military forces of the Kings of France, throughout the Early Modern period of European history, from the Late Middle Ages to the Renaissance. Their service as mercenaries was at its peak during the Renaissance when their proven battlefield capabilities made them sought-after mercenary troops. The traditional listing order of the cantons of Switzerland reflects this state, listing the eight "Old Cantons" first, with the city-states preceding the founding cantons, followed by cantons that joined the Confederation after 1481, in historical order.

The Swiss defeated the Swabian League in 1499 and gained greater collective autonomy within the Holy Roman Empire, including exemption from the Imperial reforms of 1495 and immunity from most Imperial courts. In 1506, Pope Julius II engaged the Swiss Guard, which continues to serve the papacy to the present day. The expansion of the Confederation and the reputation of invincibility acquired during the earlier wars suffered its first setback in 1515 with the Swiss defeat in the Battle of Marignano.

Reformation

The Reformation in Switzerland began in 1523, led by Huldrych Zwingli, priest of the Great Minster church in Zürich since 1518. Zürich adopted the Protestant religion, joined by Berne, Basel, and Schaffhausen, while Lucerne, Uri, Schwyz, Nidwalden, Zug, Fribourg, and Solothurn remained Catholic. Glarus and Appenzell were split. This led to multiple inter-cantonal religious wars (Kappeler Kriege) in 1529 and 1531, as each canton usually made the opposing religion illegal, and to the formation of two diets, the Protestant one meeting in Aarau and the Catholic one in Lucerne (as well as the formal full diet still meeting usually in Baden),Hughes, Christopher, Switzerland (London, 1975) p.66 ff, 84.Bonjour, Edgar et al. A short History of Switzerland (Oxford, 1952) p.191. despite this the Confederation survived.

Early Modern Switzerland

During the Thirty Years' War, Switzerland was a relative "oasis of peace and prosperity" (Grimmelshausen) in war-torn Europe, mostly because all major powers in Europe depended on Swiss mercenaries, and would not let Switzerland fall into the hands of one of their rivals. Politically, they all tried to take influence, by way of mercenary commanders such as Jörg Jenatsch or Johann Rudolf Wettstein. The Drei Bünde of Grisons, at that point not yet a member of the Confederacy, were involved in the war from 1620, which led to their loss of the Valtellina in 1623.

At the Treaty of Westphalia in 1648, Switzerland attained legal independence from the Holy Roman Empire. The Valtellina became a dependency of the Drei Bünde again after the Treaty and remained so until the founding of the Cisalpine Republic by Napoleon Bonaparte in 1797.

In 1653, peasants of territories subject to Lucerne, Bern, Solothurn, and Basel revolted because of currency devaluation. Although the authorities prevailed in this Swiss peasant war, they did pass some tax reforms and the incident in the long term prevented an absolutist development as would occur at some other courts of Europe. The confessional tensions remained, however, and erupted again in the First War of Villmergen, in 1656, and the Toggenburg War (or Second War of Villmergen), in 1712.

Napoleonic period and aftermath (1798–1848)

French invasion and Helvetic Republic

During the French Revolutionary Wars, the French army invaded Switzerland and turned it into an ally known as the "Helvetic Republic" (1798–1803). It had a central government with little role for cantons. The interference with localism and traditional liberties was deeply resented, although some modernizing reforms took place.Marc H. Lerner, "The Helvetic Republic: An Ambivalent Reception of French Revolutionary Liberty", French History (2004), 18#1, pp. 50–75.R.R. Palmer, The Age of the Democratic Revolution 2:394-421