NOVELTY - A lithium ion secondary battery comprises positive electrode (21), negative electrode (22), electrolyte solution, and middle layer which is arranged between positive electrode and negative electrode and contains melamine derivative, metal hydroxide, polyphosphate, melamine salt, and/or metal hydrates. Middle layer is entrapped into positive electrode and/or negative electrode.    USE - A lithium ion secondary battery for battery pack, electric vehicle, electric power storage system, electric tool, or electronic device (all claimed).    ADVANTAGE - The secondary has excellent battery characteristic because a part of the surface layer is entrapped into the active material layer.    DETAILED DESCRIPTION - A lithium ion secondary battery comprises positive electrode, negative electrode, electrolyte solution, and middle layer which is arranged between positive electrode and negative electrode and contains melamine derivative of formula (I), metal hydroxide, polyphosphate, melamine salt, and/or metal hydrates. Middle layer is entrapped into positive electrode and/or negative electrode.    R1-R6=H, monovalent hydrocarbon, monovalent OH-containing hydrocarbon, or group bonded so that greater than or equal to 1 monovalent hydrocarbon and greater than or equal to 1 O bond may become monovalent as a whole.    INDEPENDENT CLAIMS are included for:    (1) battery part comprising secondary battery, control part which controls operation of secondary battery, and switch part which switches operation of secondary battery according to instruction of control part;    (2) electric vehicle comprising secondary battery, conversion part which converts electric power supplied from secondary battery into driving force, drive part which is driven according to driving force, and control part which controls operation of secondary battery;    (3) electric power storage system comprising secondary battery, greater than or equal to 1 electric equipment to which electric power is supplied from secondary battery, and control part which controls electric power supply with respect to electric equipment from secondary battery;    (4) electric tool comprising secondary battery and movable part to which electric power is supplied from secondary battery;    (5) electronic device comprising secondary battery which is provided as an electric power supply source; and    (6) electrode for secondary batteries comprising active material layer and surface layer containing melamine derivative, metal hydroxide, polyphosphate, melamine salt, and/or metal hydrates in which a part of surface layer is entrapped into active material layer.    DESCRIPTION OF DRAWING(S) - The drawing shows a cross-sectional diagram of the battery element. (Drawing includes non-English language text).    Battery element (20)    Positive electrode (21)    Negative electrode (22)    Separator (23)    Middle layer (26)