Sustainably feeding the world's growing population is a challenge, and closing yield gaps (that is, differences between farmers' yields and what are attainable for a given region) is a vital strategy to address this challenge. The magnitude of yield gaps is particularly large in developing countries where smallholder farming dominates the agricultural landscape. Many factors and constraints interact to limit yields, and progress in problem-solving to bring about changes at the ground level is rare. Here we present an innovative approach for enabling smallholders to achieve yield and economic gains sustainably via the Science and Technology Backyard (STB) platform. STB involves agricultural scientists living in villages among farmers, advancing participatory innovation and technology transfer, and garnering public and private support. We identified multifaceted yield-limiting factors involving agronomic, infrastructural, and socioeconomic conditions. When these limitations and farmers' concerns were addressed, the farmers adopted recommended management practices, thereby improving production outcomes. In one region in China, the five-year average yield increased from 67.9% of the attainable level to 97.0% among 71 leading farmers, and from 62.8% to 79.6% countywide (93,074 households); this was accompanied by resource and economic benefits.