1560s, "large carnivorous reptile of the Americas," lagarto, aligarto, a corruption of Spanish el lagarto (de Indias) "the lizard (of the Indies)," from Latin lacertus (see lizard), with Spanish definite article el, from Latin ille (see le).
The modern form of the English word is attested from 1620s, with unetymological -r as in tater, feller, etc. (Alligarter was an early variant) and an overall Latin appearance. The slang meaning "non-playing devotee of swing music" is attested from 1936; the phrase see you later, alligator is from a 1956 song title.