The present invention provides a preventive or therapeutic agent for diabetes mellitus and diabetic complications, which is a new type based on an adenosine A2 receptor antagonist action. That is, it provides a novel condensed imidazole compound which has an adenosine A2 receptor antagonist action, is effective for preventing or treating diabetes mellitus and diabetic complications, and is represented by the formula (I): (wherein R represents e.g. an amino group which may be substituted with an alkyl group; R represents e.g. hydrogen atom, an alkyl group, a cycloalkyl group or an alkyl group, alkenyl group or alkynyl group which may be substituted with hydrox etc.; R represents e.g. an optionally substituted alkyl group, alkenyl group, alkynyl group, aryl group, heteroaryl group, pyridinone group, pyrimidinone group or piperadinone group; Ar represents e.g. an optionally substituted aryl or heteroaryl group; and Q and W are the same as or different from each other and each represents N or CH), a pharmacologically acceptable salt or hydrates thereof.