1530s, "corner, angle," from Middle French canton "angle, corner (of a room); piece, portion of a country" (13c.), from Italian (Lombard dialect) cantone "region," especially in the mountains, augmentative of Latin canto "section of a country," literally "corner" (see cant (n.2)).
From 1570s as a term in heraldry and flag descriptions. From c. 1600 as "a subdivision of a country;" applied to the sovereign states of the Swiss republic from 1610s.