A stochastic frontier production function is defined for panel data on maize producing regions of South Africa. Technical inefficiency effects are assumed to be a function of climatic conditions, time and the terms of trade facing maize producers. The model is derived using nine years of data for the six major maize production regions of South Africa. The results demonstrate how maize farmers have increased their efficiency in the face of a cost-squeeze. The increased efficiency seems to be driven by lower levels of intermediate input use when facing higher costs and uncertain weather conditions.