Old English ænlic, anlic "only, unique, solitary," literally "one-like," from an "one" (see one) + -lic "-like" (see -ly (1)). It preserves the old pronunciation of one.
Its use as an adverb and conjunction developed in Middle English. Distinction of only and alone (now usually in reference to emotional states) is unusual; in many languages the same word serves for both. German also has a distinction in allein/einzig. Phrase only-begotten (mid-15c.) is biblical, translating Latin unigenitus, Greek monogenes. The Old English form was ancenned.