Attempts to increase food crop yields by intensifying agricultural systems using high inputs of nonrenewable resources and chemicals frequently lead to de-gradation of natural resources, whereas most technological innovations are not accessible for smallholders that represent the majority of farmers world wide. Alternatively, cocultures consisting of assemblages of plant and animal species can support ecological processes of nutrient cycling and pest control, which may lead to increasing yields and declining susceptibility to extreme weather conditions with increasing complexity of the systems. Here we show that enhancing the complexity of a rice production system by adding combinations of compost, azolla, ducks, and fish resulted in strongly increased grain yields and revenues in a season with extremely adverse weather conditions on East Java, Indonesia. We found that azolla, duck, and fish increased plant nutrient content, tillering and leaf area expansion, and strongly reduced the density of six different pests. In the most complex system comprising all components the highest grain yield was obtained. The net revenues of this system from sales of rice grain, fish, and ducks, after correction for extra costs, were 114% higher than rice cultivation with only compost as fertilizer. These results provide more insight in the agro-ecological processes and demonstrate how complex agricultural systems can contribute to food security in a changing climate. If smallholders can be trained to manage these systems and are supported for initial investments by credits, their livelihoods can be improved while producing in an ecologically benign way.