The present invention pertains to the field of pharmaceutical chemistry and discloses 8-(3-aminopropyl)-3-exo-8-azabicyclo[3.2.1]octane-3-amino amide compounds represented by formula I, the pharmaceutical compositions, the preparation method and the use thereof. Such compounds or pharmaceutically acceptable salts thereof can be used as an antagonist of CCR5 in preparing medicaments for treating diseases mediated by CCR5, particularly HIV infection, asthma, rheumatoid arthritis, autoimmune diseases and chronic obstructive pulmonary diseases (COPD).