We study the multifunctional character of agriculture in a model of endogenous input use and land allocation augmented by biodiversity, landscape amenity, and nutrient runoff. While biodiversity and landscape amenities represent the public good aspects of agriculture, nutrient runoff represents its negative externalities. We show that the private use of fertilizer input is higher and the size of buffer strips lower than the socially optimal solution requires. Also the socially optimal land allocation differs from the private solution due to the valuation of landscape diversity and runoff damages. The optimal policy is to use a differentiated fertilizer tax and a differentiated buffer strip subsidy and to determine their levels by the equality between the net value of their marginal product in food production and their effects on the marginal valuation of diversity and runoff damage in each parcel. We characterize empirically socially optimal multifunctional agriculture and the optimal design of the policy instruments by using Finnish data.