1640s, "the making of distinctions," from Late Latin discriminationem (nominative discriminatio), noun of action from past participle stem of discriminare (see discriminate). Especially in a prejudicial way, based on race, 1866, American English. Meaning "discernment" is from 1814.
It especially annoys me when racists are accused of 'discrimination.' The ability to discriminate is a precious facility; by judging all members of one 'race' to be the same, the racist precisely shows himself incapable of discrimination. [Christopher Hitchens]