A nitrogen-containing bicyclic heterocyclic compound represented by the following formula (1) is provided. When the compound or a salt thereof is administered to a human being or an animal, the compound has a strong antagonistic action against EPl receptors, and is useful, for example, as an active ingredient of a medicine for the prevention and/or treatment of overactive bladder. The compound is also useful as an active ingredient of a medicine for the prevention and/or treatment of symptoms such as frequency urinary, urinary urgency, or urinary incontinence.