The present invention provides a nitrogen-containing heterocyclic compound represented by formula (I) and salt thereof, which is useful as an active ingredient of a fungicide for agricultural and horticultural use, having an assured effect and being safely usable.