Human behavior is strongly affected by culturally transmitted norms and values. Certain norms are internalized (i.e., acting according to a norm becomes an end in itself rather than merely a tool in achieving certain goals or avoiding social sanctions). Humans' capacity to internalize norms likely evolved in our ancestors to simplify solving certain challenges-including social ones. Here we study theoretically the evolutionary origins of the capacity to internalize norms. In our models, individuals can choose to participate in collective actions as well as punish free riders. In making their decisions, individuals attempt to maximize a utility function in which normative values are initially irrelevant but play an increasingly important role if the ability to internalize norms emerges. Using agent-based simulations, we show that norm internalization evolves under a wide range of conditions so that cooperation becomes "instinctive." Norm internalization evolves much more easily and has much larger effects on behavior if groups promote peer punishment of free riders. Promoting only participation in collective actions is not effective. Typically, intermediate levels of norm internalization are most frequent but there are also cases with relatively small frequencies of "oversocialized" individuals willing to make extreme sacrifices for their groups no matter material costs, as well as "undersocialized" individuals completely immune to social norms. Evolving the ability to internalize norms was likely a crucial step on the path to large-scale human cooperation.H uman social behavior is controlled by many interacting factors including material cost-benefit considerations, genetically informed social instincts, personality, and culturally transmitted norms, values, and institutions (1-5). A social norm is a behavior that one is expected to follow and expects others to follow in a given social situation (6, 7). Humans learn norms from parents, through educational and religious practices, and from friends and acquaintances, books, and media. The adherence to norms is socially reinforced by the approval of, and rewards to, individuals who follow them and punishment of norm violators. Certain norms are internalized, that is, acting according to a norm becomes an end in itself rather than merely a tool in achieving certain goals or avoiding social sanctions (1, 2, 8-11). For individuals who have strongly internalized a norm, violating it is psychologically painful even if the direct material benefits for the violation are positive. Many individuals and groups are willing to pay extremely high costs to enact, defend, or promulgate norms that they consider important (12). At the same time, virtually all norms can be violated by individuals under some conditions (e.g., if the costs of compliance are too high). Norms thus can be viewed as one of the arguments in the utility function that each individual maximizes (9).Internalizing a norm has two significant effects upon human behavior: People who have internalized a norm follow...