Dow Chemical Co posted a surprise first-quarter profit on Thursday, helped by cost reductions, gains in its agricultural segment and lower raw material costs.

Our positive earnings in this recessionary environment were the direct result of our rapid actions to reduce costs and tightly manage operations, Chief Executive Andrew Liveris said in a statement.

In December, Dow said it would close 20 facilities, divest several businesses and cut 5,000 jobs as it throttles back operations to deal with the global slump.

The company said it had cut spending by $270 million in the quarter from a year earlier. Purchased feedstock and energy costs were down 49 percent.

Agricultural segment sales rose about 8 percent to $1.4 billion.

There are some signs that the pace of global economic decline is moderating, Liveris said, but noted that he was not counting on material improvements in economic conditions in the near term.

The company reported net income of $24 million, or 3 cents a share, down from $941 million, or 99 cents a share, a year earlier.

Excluding items, earnings were 12 cents a share. Analysts on average expected a loss of 20 cents before special items, according to Reuters Estimates.

Sales fell 39 percent to $9.09 billion, while the analysts' average forecast was $11.61 billion.

Dow agreed to buy Rohm and Haas last year, but balked after a key joint venture with Kuwait fell apart. That acquisition was completed earlier this month after Rohm and Haas sued Dow, forcing it to close the deal.

Shares of Dow, the second-largest U.S. chemical company behind DuPont in terms of market capitalization, rose 7.3 percent to $14.50 in premarket trading.

At Wednesday's close, the stock was down about 14 percent so far this year, while the Standard & Poor's Chemicals Index <.GSPPM> was up 13 percent.

(Reporting by Hezron Selvi; Editing by Derek Caney and Lisa Von Ahn)