In 1499 the Confederation and its allies of the Three Leagues of Graubünden faced Emperor Maximilian I of Habsburg and the Swabian League, who wanted to bring them back under the institutions of the Empire. The war was fought along the Rhine, from Lake Constance to Graubünden.
The decisive victory came on 22 July at Dornach, near Basel. With the Peace of Basel, on 22 September 1499, the Confederates no longer depended on the imperial courts and taxes: it was de facto independence, which would be formally recognised in 1648.