The present invention provides a prophylactic or therapeutic agent for delirium, containing a compound (I) having an affinity for a melatonin receptor. A compound represented by the formula [wherein, each symbol is as defined in the description] or a salt thereof.