Developing polymer solar cells (PSCs) with high photovoltaic performance and mechanical robustness is one of the most urgent tasks to ensure their operational reliability and applicability in wearable devices. However, it remains challenging to enhance their mechanical properties without compromising the electrical properties of high-performance active materials. Here, we develop a series of novel polymer donors (P(D)s), with which highly efficient PSCs having remarkable mechanical reliability are demonstrated. By interposing a controlled amount of 1,10-di(thiophen-2-yl)decane flexible spacer (FS) into a PM6 backbone, we are able to significantly enhance the intermixing of the new P(D)s with a small molecule acceptor (Y7), affording sufficient pathways for efficient charge percolation and mechanical stress dissipation. As a result, PSCs based on the P-D containing 5 mol% FS units and Y7 exhibit a high power conversion efficiency (PCE) of 17% with a crack onset strain (COS) of 12% and a cohesive fracture energy (G(c)) of 2.1 J m(-2), significantly outperforming reference PM6-based devices (PCE = 15%, COS = 2% and G(c) = 1.0 J m(-2)). Both the photovoltaic performance and mechanical robustness of these PSCs are among the best values reported to date. The rational design of the P(D)s demonstrated here presents a highly promising strategy to address the mechanical properties of SMA-based solar cells and their viable application in flexible/stretchable electronics.