|département: 01, Ain|
Gex is situated at an elevation of 600 m in the département Ain of which it is the capital. Gex is also the capital (chef-lieu of the canton and the arrondissement Gex). The town is located in the foothills of the Jura mountains, at the northern edge of the Geneva basin, about 16 km northnorthwest of Geneva. The municipality has a population of about 8,900 (2004).
The earliest traces of settlements date back to about 1800 BC. During the Gallo-Roman period, a military post was located here. The earliest written mention of de Gayo dates from 1124. The spelling changed later to Gaix (1137), Jaz (1160), Gez (1227), Jayz (1234), Jax (1265), Jacium (1278), Geyz (1289), Ges (1416) and finally to Gex (1559). Later variants are Gey (1589) and Gais (1598). The name apparently goes back to the Gallo-Roman family name Gaius.
Since the early 12th century Gex was the centre of a domain which was owned by the lords of Gex. In the mid-12th century the ownerships passed to the counts of Geneva. After its occupation in 1353 by Count Amadeus VI of Savoy, Gex remained under control of Savoy for the following two centuries. In 1563 the allied troops of Berne and Geneva conquered the area and Gex was made capital of the Bernese bailiwick (Landvogtei) Pays de Gex. The new government also introduced the Protestant faith in the region. Following the Treaty of Lausanne (1564) Gex was returned to Savoy. During the wars between Savoy and Geneva, Gex was conquered again by Geneva in 1589. The Treaty of Lyon (1601) awarded Gex to France, and most of the inhabitants reverted to Catholicism. The Congress of Vienna (1815) confirmed the affiliation of Gex with France, but at the same time made Gex part of the free trade area which comprised the entire region of the Geneva basin. The resolutions regarding the Pays de Gex were annulled in 1919 by Article 435 of the Treaty of Paris (Versailles). In November 1923 France moved its customs office to Gex, and the matter was brought before the Permanent Court of International Justice (predecessor of the International Court of Justice), which decided in favour of Switzerland. A compromise was reached in 1932.
[Text adapted in part from http://en.wikipedia.org/wiki/Gex,_Ain]