WHITE PLAINS, N.Y. — A strong quarter from the company’s milling unit was not enough to offset weakness in grains and edible oils at Bunge Ltd. in the second quarter ended June 30.

Bunge sustained a loss of $21 million in the second quarter, which compared with net income of $72 million, equal to 51c per share on the common stock, in the same period a year ago.

Sales were $12,147 million, up 4.3% from $11,645 million.

Charges in the second quarter of fiscal 2018 included $16 million for severance, benefits and other costs (zero in 2017); $7 million for acquisition and integration costs in the Edible Oil Products division (zero in 2017); $3 million in sugar restructuring charges ($6 million in 2017); and $16 million in loss on disposition of equity investment in the Sugar and Bioenergy division. Overall, special charges totaled $42 million in the second quarter of 2018, versus charges of $6 million in the second quarter of 2017.

“Bunge remains on course for a very good year despite changes in trade policy and the significant uncertainty in both commodity and financial markets that we saw during the second quarter,” Soren W. Schroder, chief executive officer, said during an Aug. 1 conference call with analysts. “While Agribusiness came in somewhat below our expectations in considering the $125 million of new negative mark-to-market in soy crush and the temporary $24 million foreign currency impact in Grains, we’ve been active in securing excellent margins for the balance of the year.

“With only small amounts of soy crush capacity left open, we had a high degree of confidence in our full year guidance, supported by our forecast for a very strong second half. As reflected in the increase of working capital during the quarter, we have deliberately increased inventory of Brazilian soybeans allowing us to secure physical crush margins in both Brazil and China for the next quarters.

“During the quarter, as markets reacted to the evolving trade talks, we concluded that a quick resolution would be negative to the value of our forward soy crush capacity and the physical beans we were accumulating in Brazil. As a result, we took the prudent step to position ourselves long and futures as a hedge. Futures subsequently went lower, offsetting gains on our bean basis ownership. However, this provided us an opportunity to benefit from increasing our forward crush coverage at significantly better margins. This benefit will be visible in Q3 and Q4 as we execute on our soy crush capacity.”

Bunge’s largest division, Agribusiness, had EBIT in the second quarter of 2018 of $106 million, up sharply from $18 million in 2017. Agribusiness volumes were 37,398,000 tonnes, up 3% from 36,173,000 in the second quarter a year ago. Sales were $8,725 million in the second quarter of 2018, up 5% from $8,298 million.

Thomas M. Boehlert, executive vice-president and chief financial officer, said during the call that the improved Agribusiness results reflected an improvement in oilseeds, where soy crush margins were markedly higher than 2017 levels.

“This was driven by the combination of strong soymeal demand, lower crush rates in Argentina due to the drought and increased availability of U.S. soybeans as U.S.-China trade dynamics evolved,” Mr. Boehlert said.

EBIT of the Bunge Edible Oil Products division was $11 million in the second quarter of 2018, down 61% from $28 million in the same period a year ago. Sales were $2,325 million for the quarter, up 18% from $1,970 million.

Mr. Boehlert said the lower EBIT in Edible Oil Products reflected weaker results in Brazil, where an abundant supply of soy oil from a strong crushing environment pressured retail prices. In North America, higher volumes were more than offset by lower margins due to competitive pressures from high oil stocks, he said.

EBIT of the Milling Products division totaled $26 million in the second quarter of 2018, up 63% from $16 million a year ago. Net sales increased to $426 million from $390 million.

“Brazil was the biggest driver of the improvement where margins increased, reflecting smaller domestic wheat crops and volumes increased on share gains,” he said. “In North America, higher results in the U.S. were partially offset by lower results in Mexico.”

During the second quarter Bunge completed the sale of its interest in its renewable oils joint venture and entered the late stages of discussions to sell its international sugar and trading and distribution business. Mr. Boehlert said the company also filed in Brazil to explore the possibility of issuing an i.p.o. for its sugarcane milling business, but ultimately opted to postpone that process due to market conditions in Brazil.

Mr. Boehlert said Bunge continues to maintain “strict discipline” on capital expenditure spending. During the first half of fiscal 2018 the company invested $220 million, which compared with $342 million in the same period a year ago. The company also invested $968 million in acquisitions during the first half.

Looking ahead to the second half of fiscal 2018, Mr. Boehlert said, “Starting with Agribusiness, we expect a strong second half and a significant improvement from last year with full year EBIT toward the upper end of the range of $800 million to $1 billion.

“In Oilseeds, we’ve increased our expectations due to higher soy crush margins and the fact that we have a significant portion of our capacity for the balance of the year committed at favorable margins. We’re well supplied with soybeans in Brazil, which largely accounts for our higher level of inventory at the end of the second quarter and U.S. soy crop is developing well, which together, should allow our crush plants in these regions as well as in Europe to run at higher capacity levels through the year.

“However, we have lowered our expectation in Grains as a result of our second-quarter results, uncertainty related to the evolving freight price situation in Brazil and expectations for lower volumes and margins in the U.S. due to potentially lower exports. We saw significant volatility in agricultural commodity prices in the second quarter due to trade policy uncertainty. This dynamic will likely continue until trade policy becomes clearer. We’ll continue to closely monitor the situation.

“In Food & Ingredients, we expect results to be at the lower end of our full year EBIT outlook range of $290 million to $310 million, reflecting the softer-than-expected second-quarter Edible Oil results in South America and weaker currencies in some of our primary end markets. Second-half results are expected to improve sequentially as excess oil supplies come into better balance later in the year. Milling should continue to benefit from higher margins in Brazil due to a smaller local wheat crop.”