"You canker blossom!" 3 Shakespearean Insults
1530s, "distinguished, eminent, excellent," from Latin egregius "distinguished, excellent, extraordinary," from the phrase ex grege "rising above the flock," from ex "out of" (see ex-) + grege, ablative of grex "herd, flock" (see gregarious).
Disapproving sense, now predominant, arose late 16c., originally ironic and is not in the Latin word, which etymologically means simply "exceptional." Related: Egregiously; egregiousness.