Lucerne ( Medicago sativa L.) helps to prevent soil salinisation in the Western Australian Wheatbelt by reducing recharge to saline water tables. There is broad consensus, though, that it is not sufficiently profitable to motivate producers to plant it at the intensity at which considerable off-site benefits would be conferred. This paper employs a multiple-phase optimal control model to explore the value of this perennial pasture for the management of herbicide-resistant annual ryegrass ( Lolium rigidum Gaud.) in a crop–pasture rotation, given the difficulty of observing this value in practice. The availability of selective herbicides for efficient weed control is found to determine whether or not it is profitable to adopt lucerne pasture under optimal management. Herbicide resistance requires producers to employ costly, non-selective treatments for in-crop weed control. Thus, it motivates the adoption of perennial pasture in which cost-effective forms of control can be implemented. Moreover, this result is robust to feasible changes in the current economic environment.