Nonsuicidal self-injury (NSSI) is a serious public health problem. Identifying the factors that could help prevent or reduce NSSI is important. The current study examined the protective roles of the perceived qualities of current attachment to significant others (i.e., mothers, fathers, and peers) and self-compassion in adolescent NSSI. The potential mediating effect of self-compassion in the relationships between attachment relationships with mothers, fathers, and peers and adolescent NSSI was also explored. Self-reported data on mother, father, and peer attachment (each included 3 dimensions; i.e., trust, communication, and closeness); self-compassion; and NSSI were collected from 658 secondary school students (59.9% male; Mage = 13.58 years). Participants with NSSI experiences scored significantly higher on the perceived qualities of current attachment with parents and self-compassion than those reporting no NSSI experience. Attachment with peers did not distinguish the NSSI group from the Non-NSSI group. Further mediation analyses indicated that self-compassion mediated the relationships of closeness with mothers, fathers (partially), and peers to NSSI as well as the relationship of peer communication to NSSI. Limitations of this study and implications regarding the protective roles of attachment and self-compassion in the prevention and intervention for NSSI are discussed.