Molecular dynamics simulations are employed to investigate the grain boundary (GB)-segregation-induced strengthening and determine the maximal yield stress (MYS) in extremely fine nanograined Cu–Ag alloys, with variable grain sizes ranging from 5.2 to 17.9 nm alongside diverse solute concentrations. We discover that deformation mechanisms and yield stresses are adjustable through tailoring GB stability. The yield stress increases upon increasing solute concentration, up to a maximum (namely MYS) at a critical solute concentration for each grain size. The MYS shows a maximum of 3.70 to 3.72 GPa at a critical grain size of 7.3 to 10.3 nm. The strengthening and softening mechanisms related to GB segregation are uncovered, based on the model calculations and the dislocation analyses. Beyond the critical grain size, GB segregation suppresses GB-mediated processes while allowing dislocation activities, thereby causing a continuous strengthening. In contrast, below the critical grain size, the GBs, although being saturated, cannot withstand the resistance for GB deformation, which leads to a softening. This work presents a strategy to maximize the yield stress via synergistic optimization of grain sizes and solute concentrations, and provides insights into the design of ultrahigh-strength materials.