This study investigates the dynamic spillover effects between fossil fuels (Brent oil and natural gas) and major agricultural markets (maize, soybeans, and wheat) using a time-varying parameter vector autoregression (TVP-VAR) model. Additionally, we quantify the cumulative return of the investment portfolio, optimal weights, time-varying risk coverage, and hedging effectiveness of bivariate commodity portfolios using the Minimum Variance Portfolio (MVP), Minimum Correlation Portfolio (MCP), Minimum Connectedness Portfolio (MCoP) under bearish, tranquil, and bullish market conditions. The results show that maize and natural gas are the main net receivers of spillovers, whereas wheat and Brent oil are the main net transmitters of shocks to the network, respectively. Our findings of optimal weights in multivariate portfolio suggest more weights for agri-commodities against fossil fuels in all three modes of market. In addition, the optimal weights of bivariate portfolio analysis show that the most optimal portfolio which has the highest HE value is related to natural gas pairs with agri-commodities. Moreover, depending on the status of the market; in an average and bearish modes, the highest optimal weight is related to maize/natural gas. However, in the bullish market, the highest optimal weights are related to natural gas/Brent oil pair. Furthermore, the results of optimal bivariate hedge ratios show that natural gas/wheat (wheat/maize and vice versa) portfolio is the cheapest (the most expensive) investment strategy in all modes of market and based on MVP and MCoP approaches.