Middle English affermen, affirmen, "to decide upon" (c. 1300); "to state positively" (late 14c.), from Old French afermer (Modern French affirmer) "affirm, confirm; strengthen, consolidate," from Latin affirmare "to make steady, strengthen," figuratively "confirm, corroborate," from ad "to" (see ad-) + firmare "strengthen, make firm," from firmus "strong" (from suffixed form of PIE root *dher- "to hold firmly, support").
The spelling was refashioned 16c. in French and English on Latin model. Legal sense "declare solemnly (as before a court) but without an oath" is from early 15c. Related: Affirmed; affirming.