1590s, "disorderly retreat following a defeat," from Middle French route "disorderly flight of troops," literally "a breaking off, rupture," from Vulgar Latin rupta "a dispersed group," literally "a broken group," from noun use of Latin rupta, fem. past participle of rumpere "to break" (see rupture (n.)).
The archaic English noun rout "group of persons, assemblage," is the same word, from Anglo-French rute, Old French route "host, troop, crowd," from Vulgar Latin rupta "a dispersed group," here with sense of "a division, a detachment." It first came to English meaning "group of soldiers" (early 13c.), also "gang of outlaws or rioters, mob" (c. 1300) before the more general sense developed 14c. Also as a legal term. A rout-cake (1807) was one baked for use at a reception.