Peer aggression is a multifactorial problem and brings several consequences, among the above is school dropout. The family, community and school are related to the perception of violence and rol that students assume in an episode of violence, though bystander rol is one that has not been studied from its act, which is very important to take into account because there are different types of bystanders and that they can be contradictory in their actions, for example, encouraging bystander who helps the aggressor in an episode of violence, and defender bystander who helps the victim stopping the episode of violence. The aim was to analyze the effect of family cohesion, community attachment and school democracy on the perception of violence according to the bystander role, taking a count encouraging bystander and defender bystander. The present study is non-experimental, cross-sectional and quantitative with an explanatory scope. A sample of 1695 high school students was formed by random cluster technique. Of the sample, 873 (51.5 %) were women and 822 (48.5 %) were men and the age range between 13 and 15 years old. Six instruments were applied: general data questionnaire, FACES III, school life, neighborhood assets, prosocial behavior and school violence perception. About the results, Pearson's correlation analyzes were performed. as well as descriptive analyzes with mean and standard deviation. To get the encouraging bystander role and defender bystander role, cluster analyzes were performed taking into account the bystander, aggressor and prosocial behavior variables. Three moderation models were carried out with independent variable as family cohesion, community attachment and school democracy; dependent variable as school violence perception; and moderator variable as the type of bystander. The results showed that there is no moderation effect in the family cohesion model (β = -.04; p = .46), but the effects suggested that there is an important difference between encouraging bystander and defender bystander. The models of attachment to the community and school democracy obtained a relevant moderation effect (β = -.19; p < .00 and β = -. 15; p < .00), though the conditional effect of community attachment (β = -.07; p = .00) reflected that while the value of said variable increases, the value of encouraging bystander also increases, thus another moderation model was carried out to clarify the results of the community attachment model where the independent variable was the question "¿Do any of your friends belong to a gang?"; dependent variable was community attachment; and moderator variable remained the type of bystander. The results of the last moderation model showed a very strong moderation effect (β = -.27; p < .04) and the conditional effect (β = .24; p = .04) suggested that, for encouraging bystanders, if they have friends who belong to a gang, they increase their community attachment level, clarifying the previous results. Based on the difference found, it was concluded that the family is a relevant factor to explain peer aggression. Some findings were obtained from the obtained results. Firstly, the difference that may exist between the bystanders was verified as well as the difference effects that each socialization context can have on the type of bystander that this is, nevertheless the family cohesion is equally important regardless of the type of role, since this variable decreases the level of perception of violence in schools, regardless of the role assumed by a student. Another thing to note was the community factor, it should be studied in greater depth, since gang activity is an ambivalent factor that predicts the aggressor or encouraging bystander, but also attachment to the community is a factor that is related to the bystander defender, that is because the gang activity is related with the attachment between gang members generating affective cohesion and identifying a place as one's own. [ABSTRACT FROM AUTHOR]