We report an extensive structure‐activity relationship optimization of polysubstituted pyrimidines that led to the discovery of 5‐butyl‐4‐(4‐benzyloxyphenyl)‐6‐phenylpyrimidin‐2‐amine, and its difluorinated analogue. These compounds are sub‐micromolar inhibitors of PGE2 production (IC50 as low as 12 nM). In order to identify the molecular target of anti‐inflammatory pyrimidines, we performed extensive studies including enzymatic assays, homology modeling and docking. The difluorinated analogue simultaneously inhibits two key enzymes of the arachidonic acid cascade, namely mPGES‐1 and COX‐2, with mPGES‐1 inhibition being the principal mechanism of action. Other pyrimidines studied are potent mPGES‐1 inhibitors with no observed inhibition of COX‐1/2 enzymes. Moreover, the two most potent compounds proved to be significantly effective in vivo in a model of acute inflammation, suppressing carrageenan‐induced rat paw edema by 36 and 46 %. The promising results of this study warrant further preclinical evaluation of selected anti‐inflammatory candidates.