The Old Swiss Confederacy was the precursor of modern-day Switzerland. The Swiss Eidgenossenschaft, as the Confederacy was called, was a loose federation of largely independent small states called cantons that existed from the late 13th century until 1798, when it was invaded by the French Republic, who transformed it into the short-lived Helvetic Republic.