This paper studies the error in forecasting a dynamic time series with a deterministic component. We show that when the data are strongly serially correlated, forecasts based on a model which detrends the data before estimating the dynamic parameters are much less precise than those based on an autoregression that includes the deterministic components. The local asymptotic distribution of the forecast errors under the two-step procedure exhibits bimodality, and the forecasts are conditionally median biased in a direction that depends on the order of the deterministic trend function. We explore the conditions under which feasible GLS detrending can lead to forecast error reduction. The finite sample properties of OLS and feasible GLS forecasts are compared with forecasts based on unit root pretesting. The procedures are applied to fifteen macroeconomic time series to obtain real time forecasts. Forecasts based on feasible GLS detrending tend to be more efficient than forecasts based on OLS detrending. Regardless of the detrending method, unit root pretests often improve forecasts.