To obtain a compound represented by general formula (I), its salt, its N-oxide, its solvate or its prodrug (the meanings of all symbols are as described in the specification).The compounds represented by general formula (I) have CCR5 antagonistic effects, and the refore are useful for preventing or treating the diseases mediated by CCR5, for example, various inflanmations diseases (e.g. asthma, nephritis, nephropathy, hepatitis, arthritis, rheumatic arthritis, rhinitis, conjunctivitis, inflammatory intestinal diseases such as ulceric colitis, etc.;immune diseases (e.g. autoimmune diseases, rejection of implanted organs (rejection of solid organ graft, rejection of pancreatic cell transplant in diabetic patients, graft-versus-host, etc.), inhibition of iimmunity, psoriasis, multiple sclerosis, etc.), infectious diseases (human immunodeficiency virus infection disease, acquired immunodeficiency syndrome, RVS infection disease), allergic diseases (atopic dermatitis, urticaria, allergic bronchopulmonary aspergillosis, allergic eosinophilic gastrointestinal diseases, etc.), cardiovascular diseases (arteriosclerosis, ischemia-reperfusion injury), acute respiratory distress syndrome, shock caused by bacterial infection, diabetes mellitus, cancer metastasis, etc.本發明係通式(I)表示之化合物、其鹽、其N-氧化物、該等之溶劑化物或該等之前驅藥物(式中之符號如說明書所述)。通式(I)表示之化合物由於具有CCR5拮抗作用,可用於預防及/或治療CCR5媒介性疾病,例如各種炎症性疾病(氣喘、腎炎、腎病、肝炎、關節炎、風濕性關節炎、鼻炎、結膜炎、潰瘍性大腸炎炎症性腸疾病等等)、免疫疾病(自體免疫疾病、移植臟器排斥反應(固體臟器移植體之排斥、於糖尿病胰島細胞移植之排斥、移植體對抗宿主疾病等)、免疫抑制、乾癬、多發性硬化症等)、感染症(人類免疫不全病毒感染症、後天性免疫不全症候群、RSV感染症等)、過敏性疾病(異位性皮膚炎、蕁麻疹、過敏性支氣管肺麴菌症、過敏性嗜酸球性胃腸症等)、心血管疾病(動脈硬化症、虛血再灌流傷害之抑制等)、急性呼吸窘迫症候群、細菌感染伴隨之休克、糖尿病、癌轉移等。