The present invention relates to a compound represented by formula (I):wherein all symbols are as defined here, a salt thereof or a solvate thereof.The compound of the present invention has an antagonistic activity against CXCR4 and is therefore useful as a preventive and/or therapeutic agent for CXCR4-mediated diseases, for example, inflammatory and immune diseases (for example, rheumatoid arthritis, arthritis, retinopathy, pulmonary fibrosis, rejection of transplanted organ, etc.), allergic diseases, infections (for example, human immunodeficiency virus infection, acquired immunodeficiency syndrome, etc.), psychoneurotic diseases, cerebral diseases, cardiovascular disease, metabolic diseases, and cancerous diseases (for example, cancer, cancer metastasis, etc.), or an agent for regeneration therapy.