A heterocyclic compound of the formula (I): ##STR00001## wherein B.sup.1
is --C(R.sup.2).dbd. or --N.dbd.; R.sup.1' is H, etc.; one of R.sup.1 and
R.sup.2 is -Z.sup.1-Z.sup.2-Z.sup.3-R.sup.5 wherein Z.sup.1 and Z.sup.3
are independently single bond, optionally substituted alkylene, etc.;
Z.sup.2 is single bond, optionally substituted alkylene, etc.; R.sup.5 is
optionally substituted aryl, optionally substituted heteroaryl, etc., and
the other of R.sup.1 and R.sup.2 is H; -A.sup.1- is
--C(--Y).dbd.C(--R.sup.A)--C(--R.sup.3).dbd.C(--R.sup.4)--, etc. wherein
Y is OH, etc.; R.sup.A is --COR.sup.7 wherein R.sup.7 is OH, etc.; one of
R.sup.3 and R.sup.4 is carboxy, etc., and the other of R.sup.1 and
R.sup.2 is H, etc, a prodrug thereof, a pharmaceutically acceptable salt
thereof, and a solvate thereof, having an antiviral activity, more
particularly, an inhibitory activity against HIV integrase, and a
pharmaceutical composition containing the same, especially an anti-HIV
drug.