Funds are flowing back into agricultural commodities for the first time since 2012 as investors look to capitalize on cheap prices, bullish demand and the threat of crop damage from an El Niño weather pattern.

Figures from ETF Securities, one of the largest issuers of exchange traded products, show a small net inflow so far this year after an outflow of nearly 20 percent in 2014.

Across the sector, indices and ETFs saw a net inflow of $400 million in April and a further $400 million in May, according to data from Barclays. This compares to a net outflow of $2.4 billion in the last quarter of 2014.

The extent of the trend has been tempered in the last four weeks by an improvement in the outlook for global wheat and soybean crops, which drove down prices. Analysts, however, still expect a net inflow for the year.

"If you do look longer-term into demand trends, you're likely to see pretty solid growth year-on-year," said Martin Arnold, director of commodity strategy at ETF Securities.

"Especially now that we are beginning to see the volatility in weather conditions starting to impact the market's ability to supply the rise in demand."

Investor appetite for the agricultural sector had waned following a series of large global harvests of commodities like corn and sugar, which triggered rising stocks and falling prices.

Raw sugar futures, for example, have fallen by more than two-thirds from a peak of 36.08 cents a lb in February 2011 to a 6-1/2 year low of 11.10 cents last month.

Rising demand is, however, expected to trigger the first global sugar supply deficit in six years in the 2015/16 season.

"This kind of thing is definitely bullish for the agricultural sector," said Romain Lathiere, head of dealing at Diapason Commodities Management. "It's a really good entry point for commodity markets at the moment."

Sugar output could also potentially be curbed by El Niño, which can lead to drought in key producing countries in Asia such as India and Thailand.

Funds sources said Chinese funds are among those considering increasing their exposure to agricultural commodities in the next few months.

Renewed capital inflows have also been driven by a recent shift away from the perception that investing in agriculture leads to a spike in food prices, a factor that has pushed many European investors and banks out of the sector in recent years.

"It became safer to invest in food commodities after investors realized that it's not directly related," said Jodie Gunzberg, global head of commodities at S&P Dow Jones Indices. "Since then, we have seen more investors get back into agriculture in Europe."