The present invention provides a novel compound having an antiviral activity, in particular, an HIV replication inhibitory activity, as well as a pharmaceutical composition, in particular, an anti-HIV agent. A compound represented by formula: wherein, A3 is CR3A, CR3AR3B, N or NR3C; R3A, R3B, R4A, and R4B are each independently a hydrogen atom, halogen, cyano, substituted or unsubstituted alkyl, substituted or unsubstituted alkynyl, or substituted or unsubstituted non-aromatic carbocyclyl; R3C is a hydrogen atom, substituted or unsubstituted alkyl, or substituted or unsubstituted non-aromatic carbocyclyl; ring T1 is substituted or unsubstituted nitrogen-containing aromatic heterocycle; R1 is a hydrogen arom, halogen, cyano, or substituted or unsubstituted alkyl; R2s are each independently substituted or unsubstituted alkyl etc.; n is 1 or 2; R3 is substituted or unsubstituted aromatic carbocyclyl etc.; R4 is a hydrogen atom or a protecting group of carboxy.本發明提供一種具有抗病毒作用、尤其是HIV複製抑制活性之新穎化合物及含有其之醫藥、尤其是抗HIV藥。本發明係式:(式中,A3為CR3A、CR3AR3B、N或NR3C;R3A、R3B、R4A及R4B分別獨立為氫原子、鹵素、氰基、經取代或未經取代之烷基、經取代或未經取代之炔基、或者經取代或未經取代之非芳香族碳環式基;R3C為氫原子、經取代或未經取代之烷基、或者經取代或未經取代之非芳香族碳環式基;環T1為經取代或未經取代之含氮非芳香族雜環;R1為氫原子、鹵素、氰基、或者經取代或未經取代之烷基;R2分別獨立為經取代或未經取代之烷基等;n為1或2;R3為經取代或未經取代之芳香族碳環式基等;R4為氫原子或羧基保護基)所表示之化合物。