late 14c., "exemption from service or obligation," from Old French immunité "privilege; immunity from attack, inviolability" (14c.) and directly from Latin immunitatem (nominative immunitas) "exemption from performing public service or charge, privilege," from immunis "exempt, free, not paying a share" (see immune (adj.)). Medical sense of "protection from disease" is from 1879, from French or German.