The present invention provides a hyperglycemic inhibitor having a serine protease inhibitory action, which is a novel prophylactic or therapeutic drug for diabetes. A compound represented by the following formula (I),wherein each symbol is as defined in the description, or a pharmaceutically acceptable salt thereof