c. 1200, "latest, final, following all others," a contraction of Old English latost (adj.) "slowest, latest," superlative of læt (see late); in some uses from late (adv.). Cognate with Old Frisian lest, Dutch laatst, Old High German laggost, German letzt.
Meaning "last in space, furthest, most remote" is from late 14c.; meaning "most unlikely or unsuitable" is from mid-15c. Meaning "most recent, next before the present" (as in last night, last September) is from late 14c.; latest would be more correct, but idiom rules and the last time I saw her might mean the most recent time this hour or the final time forever.
The biblical last days ("belonging to the end") is attested from late 14c. Last hurrah is from the title of Edwin O'Connor's 1956 novel. Last word "final, definitive statement" is from 1650s. A dying person's last words so called by 1740. As an adjective, last-minute attested from 1913. Last-chance (adj.) is from 1962. Expression if it's the last thing I do, expressing strong determination, is attested by 1905.
-ly 2
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.