This paper considers the forecasting performance of a nonlinear dynamic stochastic general equilibrium (DSGE) model. The results are compared with those of a wide selection of competing models, which include a linear DSGE model and a variety of vector autoregressive (VAR) models. The parameters in the VAR models are estimated with classical and Bayesian techniques, where some of the Bayesian models are augmented with stochastic variable selection, time-varying parameters, endogenous structural breaks and various forms of prior shrinkage (where the Minnesota prior is included as a special case). The structure of the DSGE models follow that of New Keynesian varieties, which allow for nominal and real rigidities. The nonlinear DSGE model makes use of the second-order solution method of Schmitt-Grohé and Uribe (2004), and a particle filter is used to generate values for the unobserved variables. Most of the parameters in these models are estimated using maximum likelihood techniques. The models are applied to the macroeconomic data of South Africa, which is classified as an emerging market economy. The initial in-sample period of 1960Q1 to 1999Q4 is used to generate an eight-step ahead forecast. The models are then estimated recursively, by extending the in-sample period by a quarter, to generate successive forecasts over the out-of-sample period 2000Q1 to 2011Q4. We find that the forecasting performance of the nonlinear DSGE model is almost always superior to that of its linear counterpart, particularly over longer forecasting horizons. The nonlinear DSGE model also outperforms the selection of VAR models in most cases.