Ecotypes of sainfoin (Onobrychis viciifolia Scop.) have not been extensively studied, and knowledge about their variation is generally limited. In the present study, 100 sainfoin genotypes from 10 ecotypes were clonally propagated and evaluated under water‐stressed and nonstressed conditions for 2 yr. Among‐ and within‐ecotype variation plus heritability of agronomic, morphological, and physiological traits were estimated and the associations of traits were determined. For most of the measured traits among‐ and within‐ecotype effects were significant. The variance within ecotypes was at least four times higher for most of the measured traits when compared with variance among ecotypes. The within‐ecotype contribution was 67 to 71% for dry matter yield (DMY), 69% for number of stems per plant, and 69 to 91% for morphological traits. Large within‐ecotype variation for DMY and yield‐related traits could express yield stability across environments and maximize genetic progress per breeding cycle. The lowest heritability estimates were obtained for DMY and leaf‐to‐stem ratio, and the highest one was estimated for antioxidant activity and chlorophyll content. Water stress caused significant decrease in all measured traits except for carotenoid content, proline content, catalase, ascorbate peroxidase, and superoxide dismutase activity. Genotypic differences for water‐stress tolerance identified in this study were mainly attributed to the ability of tolerant ecotypes to accumulate a greater amount of proline in their leaves in response to water stress. Dry matter yield had positive correlations with plant height, inflorescence length, number of stems per plant, and proline content under both moisture environments. On the basis of factor analysis, the first three factors in both environments were considered as “forage yield components,” “photosynthetic pigments,” and “antioxidant activity.” High within‐ecotype variation indicated the importance of selection within populations for suitable parental materials in sainfoin breeding. Baft was the best ecotype under both moisture environments in this respect.