The original hipsters.
"The negative meaning arose in the late 16th century, probably originating in sarcasm. Before that, it meant outstanding in a good way. Webster also gives “distinguished” as an archaic form, and notes that its present form often has an unpleasant connotation (e.g., "an egregious error"). It generally precedes such epithets as “rogue,” “rascal,” "ass," “blunderer”."
And form the OED:
"mid 16th century (sense 2): from Latin egregius'illustrious', literally 'standing out from the flock', from ex-'out' + grex, greg- 'flock'. The derogatory sense (late 16th century) probably arose as an ironical use."