Provided is an excellent preventive or therapeutic agent for dementia, schizophrenia, etc., which acts on the basis of a serotonin 5-HT receptor modulation activity.An acylguanidine derivative characterized by having a structure in which guanidine has been bonded to one of the rings of quinoline or isoquinoline through a carbonyl group and a cyclic group has been bonded to the other ring (formula (I)) was ascertained to have a potent 5-HT receptor modulation activity and have an excellent pharmacological activity based on the modulation activity. The derivative was found to be capable of being an excellent preventive or therapeutic agent for dementia, schizophrenia, bipolar disorder, or attention deficit/hyperactivity disorder. (In formula (I), one of Z, Z, Z, Z, and Z represents a nitrogen atom and the others each represents a carbon atom.)