A fused heterocyclic compound having an enteropeptidase inhibitory action and use of the compound as a medicamentfor treatment or prophylaxis of obesity, diabetes mellitus, etc., are provided. Specifically, a compound represented by the following formula (I): wherein each symbol is as defined herein, or a salt thereof and use of the compound as a medicamentfor treatment or prophylaxis of obesity, diabetes mellitus, etc., are provided.本發明提供一種具有腸肽酶抑制作用的稠合雜環化合物,及該化合物作為治療或預防肥胖症、糖尿病的藥劑的用途等。具體而言,提供一種下式(I)代表的化合物或該其鹽:式中個別的代號在本文中定義,及該化合物作為治療或預防肥胖症、糖尿病的藥劑的用途等。