[Problem] The present invention has an object to provide a compound having a GPR40 agonistic activity, which is useful as a pharmaceutical composition, an insulin secretion promoter, or an agent for preventing/treating diabetes. [Means for Solution] The present inventors have extensively studied a compound having a GPR40 agonistic activity, and as a result, they have found that the compound (I) of the present invention or a pharmaceutically acceptable salt thereof, in which a carboxylic acid is bonded to a bicyclic or tricyclic moiety through methylene, and further, a benzene ring substituted with a monocyclic 6-membered aromatic ring is bonded to a bicyclic or tricyclic moiety through -O-methylene or -NH-methylene, has an excellent GPR40 agonistic activity. They have also found that the compound has an excellent insulin secretion promoting action and strongly inhibits increase in the blood glucose after glucose loading, thereby completing the present invention.