A heterocyclic compound represented by the general formula (in the formula, R1, R2 and R3 may be the same or different, and each represents a hydrogen atom, a halogen atom, or this general formula (X1-Y1-R4) (in the formula: X1 represents this general formula (NR5) (in the formula, R5 represents a hydrogen atom, etc.) or the like Y1 represents an optionally substituted C1-6 alkylene group or the like and R4 represents an optionally substituted aryl group or the like), and Z represents a nitrogen atom or this general formula (CR6) (in the formula, R6 represents a hydrogen atom, a halogen atom, or an optionally substituted C1-12 alkyl group or the like)), or a salt thereof, exhibits excellent anti-HIV activity and is useful as an anti-HIV agent.