A compound represented by formula (I), a salt thereof, an N-oxide thereof, a solvate thereof or a prodrug thereof: (wherein each symbol is as defined in the description.) The compounds represented by formula (I) has the antagonistic activity against CCR5, so they are useful in preventing and/or treating CCR5-related diseases, for example, various inflammatory diseases (asthma, nephritis, nephropathy, hepatitis, arthritis, rheumatoid arthritis, rhinitis, conjunctivitis, inflammatory bowel disease such as ulcerative colitis, etc. ), immunological diseases (autoimmune diseases, rejection in organ transplantation (rejection of graft of solid organ, rejection of graft of pancreatic islet cells in therapy for diabetes, graft-versus-host disease, etc. ), immunosuppression, psoriasis, multiple sclerosis, etc.), infectious diseases (infection with human immunodeficiency virus, acquired immunodeficiency syndrome, infection with RSV, etc. ), allergic diseases (atopic dermatitis, urticaria, allergic bronchoplumonary aspergillosis, allergic eosinophilic gastroenteritis, etc. ), cardiovascular diseases (arteriosclerosis, ischemic reperfusion injury, etc. ), acute respiratory distress syndrome, shock accompanying bacterial infection, diabetes, cancer metastasis and so on.