We investigate the optimal asset allocation and repayment strategy of an agricultural loan under a guaranteed repayment condition in a continuous-time setting. We propose two forms of the problem: an analytically solvable “separable” problem and a more realistic “nominal” problem that is investigated numerically. In the numerical study, we calibrate our model to publicly available farm data and explore various forms of repayment structures. While the widely used constant repayment structure has a surprisingly outstanding performance, we also design two repayment structures for the nominal problem that perform quite well.