Dryland salinity emergence is an important land degradation problem in Australia. Large areas of agricultural land where conventional crops and pastures are produced are at risk. The salinisation problem can be controlled by planting trees in conjunction with crops, but a disadvantage of growing trees as a farm enterprise is the long lag between planting and harvest. When farm forestry enterprises are evaluated with conventional discounting techniques they do not generally rank as an attractive alternative to annual crops on productive land. In this paper, a dynamic model that explicitly accounts for decline or improvement in land quality over a period of 40 years is presented. The model is solved for a hypothetical farm on the Liverpool Plains of NSW. The optimal area planted to trees and the optimal groundwater table trajectory through time are determined under a variety of scenarios. Implications of the results for policy design are discussed.