A heterocyclic compound represented by general formula (I) [wherein R represents an optionally protected amino group or an optionally substituted C alkyl group R and R independently represent a C alkyl group X represents a hydrogen atom or a halogen atom Z represents C R (wherein R represents a hydrogen atom a halogen atom an optionally protected amino group or a C alkylsulfonyl group) or N Z represents C R (wherein R represents a hydrogen atom a hydrogen atom a halogen atom an optionally protected amino group or a C alkylsulfonyl group) or N Z represents C R (wherein R represents a hydrogen atom a hydrogen atom a halogen atom an optionally protected amino group or a C alkylsulfonyl group ) or N Z represents C R (wherein R represents a hydrogen atom a hydrogen atom a halogen atom an optionally protected amino group or a C alkylsulfonyl group) or N Z represents CH or N and A represents a methylene group or a bond] or a salt thereof which has an excellent anti HIV activity and is therefore useful as an anti HIV agent.