The present invention provides a new cyclic compound having a CCR antagonist activity, especially a CCR5 antagonist activity, and the use thereof. The compound of the present invention is represented by the formula: wherein, R 1 is a 5- to 6-membered ring group which may be substituted; X 1 is a bond or the like; ring A is a 5- to 6-membered ring group which may be substituted; ring B is a 8- to 10-membered ring group which may be substituted; X 2 is a bivalent group of 1 to 4 atoms; Z 1 is a bivalent cyclic ring group or the like; Z 2 is a bond or the like; and R 2 is an amino group, a nitrogen-containing heterocyclic group which may be substituted or the like, or a salt thereof.