The present invention relates to a pyrimidine derivative of the formula (I) and salts thereof which is useful as an active ingredient of pharmaceutical preparations. The pyrimidine derivative of the present invention has excellent CRTH2 (G-protein-coupled chemoattractant receptor, expressed on Th2 cells) antagonistic activity and can be used for the prophylaxis and treatment of diseases associated with CRTH2 activity, in particular for the treatment of allergic diseases, such as asthma, allergic rhinitis, atopic dermatitis, and allergic conjunctivitis; eosinophil-related diseases, such as Churg-Strauss syndrome and sinusitis; basophil-related diseases, such as basophilic leukemia, chronic urticaria and basophilic leukocytosis in human and other mammals; and inflammatory diseases characterized by T lymphocytes and profuse leukocyte infiltrates such as psoriasis, eczema, inflammatory bowel disease, ulcerative colitis, Crohn's disease, COPD (chronic obstructive pulmonary disorder) and arthritis.