ref
late Middle English (in the sense ‘to do with Mosaic law’): from French, or from Latin legalis, from lex, leg- ‘law’. Compare with loyal.
legal + -ly