The present invention provides an agent for the prophylaxis or treatment of diabetes, which has a superior hypoglycemic action, and is associated with a fewer side effects such as body weight gain and the like. The resent invention relates an agent for the prophylaxis or treatment of diabetes, which comprises a compound represented by wherein each symbol is as defined in the description, or a salt thereof or a prodrug thereof.