Switzerland's history cannot be understood without considering its geography, which has had a considerable impact on determining the development of its way of life.
The country that we know today took its final shape only in 1848. Before that time, we cannot really speak of "Swiss history," but rather the history of its various parts, which only gradually came together.
The oldest traces of human existence in Switzerland date back about 150,000 years, and the oldest flint tool found in the country is thought to be about 100,000 years old.
The best known early prehistoric site is at Cotencher in Canton Neuchâtel, where Neandertal hunters left flint cutting tools in a cave some 60,000 years ago.
Farming reached central Europe from the Mediterranean area in the 6th millennium BC. The oldest known farming settlements in Switzerland are those found at Gächlingen in Canton Schaffhausen, which have been dated to around 5300 BC.
Metal - in the form of copper - was first made in Switzerland around 3800 BC, and bronze - a much harder and stronger alloy of copper and tin - some 1500 years later. The iron age began in Switzerland around 800 BC.
Although copper ore was found locally, tin had to be imported - an indication that trade was already highly developed.
The so-called "Amesbury Archer", or "King of Stonehenge", buried in southern Britain around 2300 BC, and discovered in 2002, probably came from what is now Switzerland.
Alamans to the Holy Roman Empire: general overview
The period following Roman rule, generally known as the Dark Ages or Early Middle Ages, lasted from about 400 to 1000.
The territory of what is now Switzerland shared a similar evolution with the rest of western Europe.
The first couple of centuries or so was a time of migration, moving in the general direction of east to west. Peoples were displaced as waves of new tribes arrived from Asia.
Switzerland was settled by different peoples, who brought not only new lifestyles, but also new languages.
Christianity which had arrived in Switzerland under the Romans, took root and spread, partly through the work of missionaries. The church, with its system of bishoprics and monasteries, became a major landowner with rights over all those who lived on its lands.
At the same time, noble families were increasing their power and building up their landholdings by conquest, inheritance and marriage.
For a brief period the Frankish king Charlemagne controlled much of Western Europe and took the title Emperor of the West in 800.
However, even under Charlemagne there was no idea of a state. At every level of society, relations between weak and strong were based on personal allegiance. The emperor ruled through a network of noble families.
Throughout the period, and beyond, the balance of power between kings, dukes and the church constantly shifted as each jockeyed to preserve its old privileges or to grab new ones.
A further level of power was added in 962 when the German king Otto I persuaded the Pope to crown him Emperor of what much later became known as the Holy Roman Empire.
Middle Ages: general overview
The year 1291 is traditionally regarded as the foundation of the Swiss Confederation, when three rural communities made an alliance to protect their freedoms against encroachments by would-be overlords.
The 14th and 15th centuries saw this group expand to a loose confederation with both rural and urban members. By the end of the period the Confederation was strong enough to have a serious impact on the balance of power in Europe in wars where their troops gained a fearsome reputation for their skill and courage.
Expansion proceeded in several ways. In some cases new members joined the Confederation as equals; other communities or territories came by purchase or conquest.
The rights of the inhabitants of the Confederation still depended both on the place where they lived and on their position in society.
The Confederate members administered their own affairs, but also held frequent diets to discuss issues of common interest. In this period Zurich, Bern and Lucerne took it in turns to summon the meeting. Each member sent one or two representatives, drawn from the political leadership.
The Reformation: general overview
The 16th century was a time of upheaval throughout western Europe, when a movement to reform the Roman Catholic church split western Christendom into two opposing camps, as Protestants rejected the authority of the Pope.
Although the movement was ostensibly a religious one, it reflected deep underlying tensions in the social structure. In Switzerland, as elsewhere, it was accompanied by riots and destruction. Supporters of the reform all over Europe smashed the "idolatrous" statues and pictures in churches, and threw monks and nuns out of their monasteries, in many cases never to return.
But discontent went beyond obvious manifestation of discontent with the church to attack the very structure of society. "Extremist" Protestant movements like the Anabaptists, which found their followers in the rural regions and which among other things called for an end to tithes and rents, were forcibly repressed by mainstream Protestant leaders.
Theological debate gave rise to a debate about tolerance; Geneva adopted an authoritarian stance, imprisoning, expelling or even burning those Protestants who disagreed with the official line, while Basel became a centre of intellectual freedom.
The 17th century: general overview
The 17th century saw three further landmarks in the development of modern-day Switzerland. All came as a result of the 30 Years War (1618-48), which ravaged large swathes of Europe, particularly Germany, but in which the Confederation succeeded in remaining neutral.
Firstly, the war made it clear to the Confederation members that despite their deep differences, it was in their interest to stay together as the only way to avoid being drawn into a Europe-wide conflict.
Secondly, they gradually formalised the important policy of armed neutrality, to prevent border incursions by the warring armies.
Thirdly, Swiss independence from the Holy Roman Empire was formally recognised by signatories of the Treaty of Westphalia, which ended the war.
Despite this, Switzerland was not a haven of peace. Both social and religious tensions sparked armed conflict within the country in the second half of the century.
The 18th century: general overview
The 18th century was a period of relative peace and prosperity, until its last decade when French revolutionary troops invaded and destroyed the old political system.
During the 18th century, great advances were made in scientific agriculture. New industries got off the ground, including clockmaking and textiles.
Learned and patriotic societies sprang up all over the country. Swiss intellectuals discussed new scientific and philosophical ideas with their counterparts abroad. At the same time, they promoted Swiss national awareness, going beyond narrow cantonal boundaries.
The new industrial and intellectual elite challenged the entrenched ruling circles.
The century ended in Europe-wide turmoil after the French revolution and France's subsequent wars against European monarchies.
French troops invaded Switzerland in 1798, broke the power of the ruling élites there and temporarily destroyed the cantonal system by creating the centralised Helvetic Republic.
For the first and only time in their history the Swiss were forced to abandon their neutrality and provide troops for France.
The federal state: general overview
The foundations of modern Switzerland were laid down in the 19th century. The most important event was undoubtedly the adoption of the 1848 constitution, which gave the country a more centralised government and created a single economic area where cantonal rivalries had previously hindered development.
Among other things the new goverment abolished internal tolls, it unified weights, measures and the currency and it took charge of the postal system.
These moves made possible the development of many of the industries and services which are still the cornerstone of Switzerland's prosperity, such as chemicals, engineering, the food industry and banking.
However, for many people conditions continued to be very difficult. Poverty, hunger and lack of employment prospects encouraged large-scale emigration throughout the 19th century, much of it to north and south America.
The 20th century: general overview
The 20th century saw important changes in Switzerland in both domestic and foreign policy.
The political system opened up. At the beginning of the century a single party dominated the government; by the end of it four parties had guaranteed ministerial posts.
The economy ran into difficulties in the 1920s and 30s, but overall Switzerland prospered. The move away from agriculture and into highly skilled specialist industries continued. From being a country of emigration, in the second half of the century it became a country which drew immigrants.
The standard of living increased dramatically for most people. They gained far better social security and working conditions, as well as access to an extensive range of consumer goods.
The century also saw a sharp shift in Switzerland's relations with Europe and the rest of the world.
For most of the period Switzerland continued outside the European mainstream. It took no active part in either of the two World Wars. However it later found it harder and harder to remain a "special case" in the face of globalisation and European integration. The issue of Swiss neutrality remained a central topic of debate.
At the end of the century, Switzerland reexamined its role in World War II. The Bergier commission of expert historians investigated criticism of Switzerland's wartime behaviour and produced its final report in 2002. The Bergier report has been a key element in leading the public to re-evaluate a period of history which had previously been largely ignored. Its thorough investigation threw light on both positive and negative aspects of Swiss behaviour.