late 14c., necesserili, "inevitably, unavoidably, so that it cannot be otherwise," from necessary (adj.) + -ly (2). As "a necessary result or consequence" from c. 1500.
Entries linking to necessarily
necessary adj.
late 14c., necessarie, "needed, required; essential, indispensable; such as must be, that cannot be otherwise; not voluntary or governed by chance or free will," from Old French necessaire "necessary, urgent, compelling" (13c.), and directly from Latin necessarius "unavoidable, indispensable, necessary," from necesse "unavoidable, indispensable," originally "no backing away," from ne- "not" (from PIE root *ne-) + cedere "to withdraw, go away, yield" (from PIE root *ked- "to go, yield").
The etymological sense is of that from which there is no evasion, that which is inevitable. Necessary house "privy" is from 1610s (compare Medieval Latin necessarium "a privy"). Necessary evil is from 1540s (the original reference was to "woman").
-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.