As a historical reality, William Tell probably never existed. But as a national legend, the man who helped to drive out Switzerland's foreign rulers by shooting an apple off his son's head has perfectly embodied the country's rather singular approach to independence throughout the ages.
Modern Swiss history is regarded as starting in 1291, but people had already been living in the region for thousands of years. The first inhabitants were Celtic tribes, including the Helvetii of the Jura and the Mittelland plain and the Rhaetians near Graubünden. Their homelands were invaded firstly by the Romans, who had gained a foothold by 58 BC under Julius Caesar and established Aventicum (now Avenches) as their capital. Then, Germanic Alemanni tribes arrived to drive out the Romans by AD 400.
The Alemanni groups settled in eastern Switzerland and were later joined by another Germanic tribe, the Burgundians, in the western part of the country. The latter adopted Christianity and the Latin language, laying the seeds for the division between French- and German-speaking Switzerland. The Franks conquered both tribes in the 6th century, but the two areas were torn apart again when Charlemagne's empire was partitioned in 870.
Initially, when it was reunited under the pan-European Holy Roman Empire in 1032, Switzerland was left to its own devices. Local nobles wielded the most influence, especially the Zähringen family - who founded Fribourg, Bern and Murten, and built a castle at Thun - and the Savoy clan, who established a ring of castles around Lake Geneva, most notably Château de Chillon.
However, when the Habsburg ruler Rudolph I became Holy Roman Emperor in 1273, he sent in heavy-handed bailiffs to collect more taxes and tighten the administrative screws. Swiss resentment quickly grew.
It was after Rudolph's death in 1291 that local leaders made their first grab for independence. It's taught in Swiss schools, although some historians see the tale as slightly distorted, that the forest communities of Uri, Schwyz and Nidwalden met on the Rütli Meadow in Schwyz canton on 1 August that year to sign an alliance vowing not to recognise any external judge or law. In any case, a pact does exist, preserved in the town of Schwyz. It's seen as the founding act of the Swiss Confederation, whose Latin name, Confoederatio Helvetica, survives in the 'CH' abbreviation for Switzerland (used on car number plates and in Internet addresses, for example). The story of the patriotic William Tell, a central figure in the freedom struggle's mythology, also originates from this period.
In 1315, Duke Leopold dispatched a powerful Austrian army to douse this growing Swiss nationalism. Instead, however, the Swiss inflicted an epic defeat on his troops at Morgarten and prompted other communities to join the Swiss union. The next 200 years of Swiss history was a time of successive military wins, land grabs and new memberships. The following cantons came on board: Lucerne (1332), Zürich (1351), Glarus and Zug (1352), Bern (1353), Fribourg and Solothurn (1481), Basel and Schaffhausen (1501) and Appenzell (1513). In the middle of all this, the Swiss Confederation gained independence from Holy Roman Emperor Maximilian I after a victory at Dornach in 1499.
Then, having made it as far as Milan, the rampaging Swiss suddenly lost to a combined French and Venetian force at Marignano in 1515. This stinging defeat prompted them to withdraw from the international scene and for the first time declare neutrality. For several centuries afterwards, the country's warrior spirit was channelled solely into mercenary activity - a tradition still echoed in the Swiss Guard that protects the pope.
The country's neutrality and diversity combined to give Switzerland some protection when the religious Thirty Years' War broke out in 1618, although parts of it still suffered. The Protestant Reformation and the subsequent Catholic Counter Reformation had caused deep divisions and upheaval throughout Europe. In Switzerland, too, preacher Huldrych Zwingli had started teaching the Protestant word in Zürich as early as 1519, as had Jean Calvin in Geneva. But Zentralschweiz (central Switzerland) remained Catholic.
So, unable to agree even among themselves, the Swiss couldn't decide which side to take in the Thirty Years' War and fortuitously stuck to their neutrality.
However, religious disputes dragged on inside Switzerland. At first, the Catholic cantons were sucked into a dangerous alliance with France, before eventually agreeing to religious freedom. At the same time, the country was experiencing an economic boom through textile industries in the northeast.
The French invaded Switzerland in 1798 and established the brief Helvetic Republic. But they were no more welcome than the Austrians before them, and internal fighting prompted Napoleon (now in power in France) to restore the former Confederation of cantons in 1803 (the Act of Mediation), with France retaining overall jurisdiction. Further cantons joined the Confederation at this time: Aargau, St Gallen, Graubünden, Ticino, Thurgau and Vaud.
After Napoleon's defeat by the British and Prussians at Waterloo in 1815, the Congress of Vienna peace treaty for the first time formally guaranteed Switzerland's independence and neutrality, as well as adding the cantons of Valais, Geneva and Neuchâtel.
Civil war broke out in 1847, during which the Protestant army, led by General Dufour, quickly crushed the Sonderbund (or special league) of Catholic cantons, including Lucerne. In fact, the war lasted just 26 days, later leading German Chancellor Bismarck to dismissively declare it 'a hare shoot'. Victory by Dufour's forces was rapidly underlined with the creation of a new federal constitution in 1848 - largely still in place today - and the naming of Bern as the capital.
The constitution was a compromise between advocates of central control and conservative forces wanting to retain cantonal authority. The cantons eventually relinquished their right to print money, run postal services and levy customs duties, giving these to the federal government. However, they retained legislative and executive control over local matters. Furthermore, the new Federal Assembly was established in such a way as to give cantons a voice. The lower national chamber, or Nationalrat, has 200 members, allocated from the 26 cantons in proportion to population size. The upper states chamber, or Ständerat, comprises 46 members, two per canton.
Lacking in mineral resources, Switzerland developed cottage industries and skilled labourers began to form guilds. Railways and roads were built, opening up Alpine regions and encouraging tourism. Between 1850 and 1860, six new commercial banks were established. The International Red Cross was founded in Geneva in 1863 by Henri Dunant.
Opposition to political corruption sparked a movement for greater democracy. In 1874, the constitution was revised so that many federal laws had to be approved by national referendum - a phenomenon for which Switzerland remains famous today. A petition with 50,000 signatures can challenge a proposed law; 100,000 signatures can force a public vote on any new issue.
Despite some citizens' pro-German sympathies, Switzerland's only involvement in WWI lay in organising Red Cross units. After the war, Switzerland joined the League of Nations, but on a strictly financial and economic basis, without military involvement.
Although Swiss industry had profited during the war, the working classes had suffered as prices soared and wages fell. Consequently, a general strike was called in November 1918. With the country at a halt, the Federal Council eventually accepted some of the strikers' demands; a 48-hour week was introduced and the social security system was extended, laying the groundwork for today's progressive social state.
Switzerland was left largely unscathed by WWII. Apart from some accidental bombings, the most momentous event of the war for the country came when Henri Guisan, general of the civilian army, invited all top military personnel to the Rütli Meadow (site of the 1291 Oath of Allegiance) to show the world how determined the Swiss were to defend their own soil.
Although Switzerland proved a safe haven for escaping Allied prisoners, the country's banks have since been criticised for being a major conduit for Nazi plunder during WWII.
Switzerland's post-war history has been dominated by economic, social and political stability. The Swiss were horrified when these started to unravel slightly at the end of the 20th century, but recently have become reconciled to being a little more ordinary.
Immediately after the war, that certainly wasn't the case. While the rest of Europe was still recovering, Switzerland was able to forge ahead from an already powerful commercial, financial and industrial base. Zürich developed as an international banking and insurance centre, while the World Health Organization and many other international bodies set up headquarters in Geneva. Its much-vaunted neutrality led it to decline to actually join either the UN or the EU, but the country became one of the world's richest and most respected.
Then, in the late 1990s, a series of scandals forced Switzerland to begin reforming its famously secretive banking industry. In 1995, after pressure from Jewish groups, Swiss banks announced that they had discovered millions of dollars lying in dormant pre-1945 accounts, belonging to Holocaust victims and survivors. Three years later, amid allegations that they had been sitting on the money without seriously trying to trace its owners, the two largest banks, UBS and Credit Suisse, agreed to pay $1.25 billion in compensation to Holocaust survivors and their families.
Banking confidentiality dates back to the Middle Ages here, and was enshrined in law in 1934, when numbered, rather than named, bank accounts were introduced. However, in 2004, the country made another concession to that veil of secrecy, when it agreed to tax accounts held in Switzerland by EU citizens.
The year 2001 was truly Switzerland's annus horribilus. The financial collapse of the national airline Swissair, a canyoning accident in the Bernese Oberland that killed 21 tourists, an unprecedented gun massacre in the Zug parliament and a fatal fire in the Gotthard Tunnel, all within 12 months, prompted intense soul-searching.
However, when devastating floods washed through the country in 2005, causing several deaths and an estimated Sfr2 billion damage, there were fewer anguished cries about what was going wrong with Switzerland and more pragmatic debate on what should be done.
While swinging to the conservative right in its parliamentary government in 2003, the country also recognises that it's facing universal challenges, and has reached out more to the world. In 2002 it finally became the 190th member of the UN. In 2005 it joined Europe's 'Schengen' passport-free travel zone and, in theory, opened its borders to workers from the 10 new EU members.
It still isn't a member of the EU itself and, although the French-speaking regions would like it, doesn't look like becoming one any time soon. However, in many ways Switzerland no longer views isolation as quite so splendid.