Large areas of agricultural land under conventional crops and pastures are at risk of dryland salinisation in Australia. The salinisation problem can be controlled by strategic and large‐scale planting of trees; however, farm forestry enterprises evaluated with conventional discounting techniques do not generally rank as an attractive alternative to annual crops on productive land. In this article, an optimal control model that explicitly accounts for decline or improvement in land quality over a period of 40 years is presented. 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.