Old English carfullice "sorrowfully;" see careful + -ly (2). The meaning "heedfully" is in late Old English.
Entries linking to carefully
careful adj.
Old English cearful "mournful, sad," also "full of care or woe; anxious; full of concern" (for someone or something), thus "applying attention, painstaking, circumspect" (late Old English), the main modern sense; from care (n.) + -ful. In Middle English also "miserable, unfortunate," of persons or things; "causing fear, frightening, terrible." Careful-bed (early 14c.) was "sick-bed;" careful-day (c. 1200) was "judgment day."
Dragons dryfes doun
With kene carefull crie.
["The Wars of Alexander," c. 1400]
-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.