Agricultural intensification of farming systems in sub-Saharan Africa is a prerequisite to alleviate rural poverty and improve livelihoods. Legumes have shown great potential to enhance system productivity. On-farm experiments were conducted in different agro-ecological zones (AEZ) in Western Kenya to assess the agronomic and economic benefits of promising legumes. In each zone, trials were established in fields of high, medium and low fertility to assess the effect of soil fertility heterogeneity on legume productivity and subsequent maize yield. Common bean, soybean, groundnut, lima bean, lablab, velvet bean, crotalaria, and jackbean were grown in the short rains season, followed by maize in the long rains season. Alongside, continuous maize treatments fertilised at different rates were established. AEZs and soil fertility gradients within these zones greatly affected crop productivity, returns to land and labour of rotations, as well as the relative performance of rotations. Poorer soil fertility and AEZs with lower rainfall gave smaller legume and maize yields and consequently, smaller returns to land and labour. The cultivation of legumes increased maize yields in the subsequent long rains season compared with continuous maize receiving fertiliser at a similar rate, while the increase of maize after green manure legumes was stronger than that after grain legumes. Maize yield responded strongly to increasing amounts of N applied as legume residues with diminishing returns to legume-N application rates above 100kgNha−1. In the low potential zones, factors other than improved N availability likely also stimulated maize yield. Rotations with grain legumes generally provided better returns than those with green manures. Intercropping bean with maize in the long rains season provided an additional bean yield that did not come at the expense of maize yield and improved returns to land and labour, but more so in the high potential zones. The results demonstrate the strong impact of biophysical diversity on the productivity of the legumes and suggest the need for careful targeting of legume technologies to the different biophysical conditions.