This study aims to assess the economic and environmental performance of watermelon production in Guilan province using the Material Flow Cost Accounting (MFCA) methodology. While MFCA has been extensively applied in industrial sectors, its application in agriculture remains limited, and this study contributes to closing that gap by providing one of the first detailed agricultural case studies. In this study, MFCA was applied to watermelon farming in Iran using the ISO 14051 framework, with costs categorized into material, energy, system, and waste management components, and outputs classified as either product or material loss. This research compares the differences between traditional Cost Accounting (CA) and MFCA, especially in terms of accounting for negative environmental impacts and incorporating these effects into economic evaluations. The analysis of the watermelon production process involved quantifying various input resources. These included human labor, agricultural machinery, chemical fertilizers, biocides, machinery fuel, and energy for irrigation and farming operations. Key inputs included 711.3 hours of labor, 52.2 kg of agricultural machinery, 426.7 kg of nitrogen fertilizer, 125.9 kg of phosphate fertilizer, 113.1 kg of potassium fertilizer, and 385.9 kg of farmyard manure. The energy consumption was 55 l of diesel and 260.5 kWh of electricity for irrigation and farming operations. The production process resulted in a primary positive output: a watermelon yield of 27529 kg. However, the production also resulted in several negative outputs with environmental implications, including ammonia (NH3) and nitrous oxide (N2O) emissions to the air, water pollution due to nitrate and phosphate runoff, and biocide emissions to soil, water, and air. Additionally, 1376.5 kg of watermelon was lost, indicating a decrease in overall production efficiency. The inputs cost $940.91, generating revenue of $5505.9 from watermelon sales. The negative outputs, including emissions, runoff, and yield loss, totaled $309.35, reflecting the environmental and resource inefficiencies in the production process. A comparison of the key economic indicators between MFCA and CA revealed that MFCA accounts for the economic value of negative products, such as emissions and waste, leading to a higher overall economic value. For instance, the Gross Value of Production (GVP) under MFCA was $5814.98, compared to $5,505.90 under CA. This more rigorous accounting demonstrates that a significant share of hidden costs arises from environmental inefficiencies, providing actionable insights for both farmers and policymakers. This study highlights the potential of MFCA to offer a more comprehensive framework for understanding how reducing environmental losses, such as emissions and waste, can simultaneously improve financial returns. It recommends that farmers adopt precision agriculture technologies, use organic fertilizers, and integrate renewable energy sources to reduce environmental impacts and enhance production efficiency. The findings not only confirm the economic benefits of MFCA but also underscore its broader significance for sustainable agriculture, showing that the methodology can be replicated for other crops and regions. By linking profitability with sustainability goals, this research demonstrates the relevance of MFCA for improving resource efficiency, guiding agricultural policy, and contributing to global food security.