DuPont ( DD) posted a third-quarter loss, warned of a fourth-quarter earnings shortfall and set a $5 billion stock buyback plan.

The Wilmington, Del., chemicals giant lost $82 million, or 9 cents a share, reversing the year-ago profit of $331 million, or 33 cents a share. Revenue rose 5% from a year ago to $6.2 billion. The latest quarter was hit by costs related to an overseas-profit repatriation plan and damage from the Gulf Coast hurricanes. Excluding those costs, latest-quarter earnings rose 32% from a year ago to 33 cents a share, DuPont said. Analysts surveyed by Thomson First Call had been looking for a 29-cent profit on sales of $6.12 billion.

The company said local prices rose 4% from a year ago, more than offsetting higher ingredient and energy costs. Volume growth in Asia, Latin America and Eastern Europe offset slowing volumes in the U.S. and Western Europe, DuPont said.

"We continued our positive momentum with our seventh consecutive quarter of margin expansion," said CEO Charles O. Holliday Jr. "However, soaring energy and ingredient costs are causing a structural shift that will create challenges for our customers, suppliers, and our own operations. We have initiated a number of actions today to ensure we achieve our sustainable growth goals despite these new challenges."

The company said it would buy back $3 billion in stock immediately, under a plan in which it will buy the shares at Monday's closing price from Goldman Sachs and Goldman will then buy shares in the open market over nine months. The company said it would buy back as much as $2 billion in added stock in coming years.

DuPont said it would make efforts in coming years to better deploy capital by keeping inventories lean, boosting productivity and expanding its bio-based materials unit.

The company said the buyback would have no effect on its fourth quarter, when DuPont forecast a profit of 20 to 25 cents a share, due to weak results in Agriculture and Nutrition and hurricane-related damage in two other units. Analysts were looking for earnings of 37 cents.

DuPont was set to open Tuesday at $39.62.

More from Stocks

Video: Jim Cramer on Tariff Worries, Oil, Alphabet and Centene

Video: Jim Cramer on Tariff Worries, Oil, Alphabet and Centene

Emerging Markets Get Pounded by Trade War Concerns

Emerging Markets Get Pounded by Trade War Concerns

Worth a Stunning $6.6 Trillion, Tech Stocks Have Taken Over the Market

Worth a Stunning $6.6 Trillion, Tech Stocks Have Taken Over the Market

Dow Tumbles, Stocks Slide on Renewed Trade War Concerns

Dow Tumbles, Stocks Slide on Renewed Trade War Concerns

Second-Quarter Earnings on Track for Massive Growth, So Relax Wall Street

Second-Quarter Earnings on Track for Massive Growth, So Relax Wall Street