The present invention provides a novel aminopyridine derivative that is excellent in pharmaceutical effects such as a neuroprotective effect, a neurogenesis or nerve regeneration promoting effect, and a cognitive function improving effect and, preferably, is low toxic and delivered at a high rate to the central nervous system. Specifically, the present invention provides a compound represented by the formula (I), wherein ring A represents a monocyclic aromatic hydrocarbon ring or the like; ring B may further have a substituent(s); ring D represents a monocyclic aromatic hydrocarbon ring or the like; L represents a bond, or a methylene group or the like; X represents -NRa- or the like, wherein Ra represents a hydrogen atom or the like; n represents 1 or 2; and R1 to R3 each represent a hydrogen atom or the like, wherein ring A and ring D each may be condensed with another ring to form a condensed ring which may have a substituent(s), and ring A-L- in the formula (I) may be bonded to X, provided that when ring A is pyrazole which may be substituted and ring D is benzene which may be substituted, L is a bond; or a salt thereof.