Formal credit plays an important role for the development of the agriculture sector in developing countries because many farmers are characterized as liquidity constrained. Access to credit can increase farmers' purchasing power for inputs and agricultural technology, thus raising the overall productivity. Farmers in Mali are particularly vulnerable to shocks, such as heavy precipitation events. Access to liquidity to increase the resilience of the agricultural sector is essential. Therefore, higher financing volumes are required, which make the analysis of loan demand in agriculture of interest. The purpose of this paper is to empirically investigate the role of the interest rate, the macroeconomic environment, the agricultural cycle and the gender of the farmer on the loan demand in the agricultural sector from a country in the Sahel. Unique and comprehensive loan data at the farm level, provided by a commercial Malian bank, is used for this analysis. The analysis covers the period from 2010 to 2020. Two different estimation strategies are combined. First, an ordinary least square regression is applied with the granted loan amount as the dependent variable. Second, the machine learning technique, least absolute shrinkage and selection operator, is applied to select the most relevant features to be used as explanatory variables in the estimation. The results reveal that the interest rate, the gross value added, the farmer's gender as well as the agricultural cycle have statistically significant effects on the granted loan demand in agriculture. These results are of interest to policymakers, who deal with financial inclusion as well as market failures, and agricultural financial institutions who could incorporate such information in the design of future loan products to stimulate farmers' loan demand, especially for female farmers. [EconLit Citations: G20, G21, O13, O16, Q14, Q18].