The town gave its name to the Pays de Gex, at various times under the jurisdiction of France, Switzerland and the Duchy of Savoy.
Around 220 BC, a group of Gallic warriors known as the Gaesatae resided in the area around Gex.
The pays de Gex was returned to the Duchy of Savoy by the treaties of Nyon in 1563 and Lausanne in 1564.
Savoy, with the assistance of Spain, tried several times to take back the pays de Gex, but they were unsuccessful.
In 1601, during the reign of Henry IV, control of the pays de Gex passed to France as part of the Treaty of Lyon.