The origins are eccleistical, according to the Oxford English Dictionary:
[ad. L. anniversari-us returning yearly, f. ann-us year + vers-us turned, a turning + -ari-us: see -ary. Cf. advers-arius, f. advers-us. Used in med.L. subst. as anniversaria (sc. dies), and anniversarium, both ecclesiastical terms, whence also the subst. use is the earliest in Eng. Cf. Fr. anniversaire.]
The word was at first ecclesiastical: ‘Anniversary days were of old those days, wherein the Martyrdoms or Deaths of Saints were celebrated yearly in the Church; or the days whereon, at every years end, Men were wont to pray for the Souls of their deceased Friends, according to the continued Custom of Roman Catholicks.’ Blount Law Dict. 1691.
The earliest use recorded in the
OED is the following:
c1230 Ancr. R. 22 Ine anniuersaries, ̃et is ine munedawes of ower leoue vreond.