The therapeutic relationship constitutes the central axis of mental health nursing. The clinical practice environment has been empirically related to the quality of care. However, the relationship between the two constructs is unknown in the setting of mental health units. We aimed to examine whether the practice environment and nurses’ characteristics influence the therapeutic relationship in mental health units. Through a cross‐sectional design, data were collected via an online form completed by nurses in 18 mental health units. Linear regression was used to examine the relationship between the clinical practice environment and the therapeutic relationship. Questionnaires were completed by 198 participants. The mean age was 33.8 (SD 9.1) years, 71.7% were women, and only 20.2% had a specialist qualification in mental health. The therapeutic relationship was better when there was a more favourable practice environment (B: 3.111; 95% CI: 1.46–4.75). The most influential environment‐related factor was the nursing foundations for quality of care (B: 2.124; 95% CI: 0.17–4.07). The factors associated with a high‐quality therapeutic relationship were a more favourable practice environment and the presence of more foundations for quality nursing care, coupled with higher academic attainment and longer nursing experience. Institutions should take into account the importance of the nursing practice environment in mental health units. Aspects related to the quality of nursing foundations, such as training, the use of nursing language and taxonomy, and the existence of a common nursing philosophy, are influential for a high‐quality therapeutic relationship.