A heterocyclic compound represented by the following general formula and salts thereof is provided, (in formula, R1, R2 and R3 represent same or different hydrogen atom, halogen or formula X1-Y1-R4, wherein X1 represents formula NR5, wherein R5 is hydrogen atom and the like, Y1 is optionally substituted C1-6 alkylene and the like, R4 is optionally substituted aryl and the like Z represents nitrogen atom or formula CR6, wherenin R6 is hydrogen atom, halogen or optionally substituted C1-12 alkyl and the like), which has excellent anti-HIV activity, and is useful as being anti-HIV agent.一種下列通式所表示的雜環化合物或其鹽,「式中,R1、R2及R3係表示相同或相異之氫原子、鹵素原子或通式X1-Y1-R4「式中,X1表示通式NR5「式中,R5意指氫原子等」等;Y1意指可經取代的C1-6伸烷基等;R4意指可經取代的芳基等」;Z表示氮原子或通式CR6「式中,R6意指氫原子、鹵素原子或可經取代的C1-12烷基等」」,其具有優異的抗HIV活性,而有用於作為抗HIV劑。