Chip gear maker Lam Research Corp posted a surprise profit as it cut costs and benefited from strong shipments, and forecast second-quarter revenue above analysts' expectations, sending its shares up 4 percent.

Lam Research, which supplies tools for etching circuits onto microchips, forecast second-quarter revenue of $450 million, plus or minus $10 million, compared with analysts' estimate of $342.1 million.

Moving into the December quarter, the company also sees shipments of about $480 million compared with $355 million in the September quarter.

Lam Research, which competes with Applied Materials Inc, Novellus Systems Inc and KLA Tencor Corp, noted that the business environment had clearly improved during September quarter.

The company, whose customers include South Korea's Samsung Electronics, IBM and STMicroelectronics, posted first-quarter net income of $16.8 million, or 13 cents per share. Excluding items, it earned 3 cents a share.

Revenue fell 28 percent to $318.5 million.

Analysts on average expected a loss of 8 cents a share, excluding exceptional items, on revenue of $294.6 million, according to Thomson Reuters I/B/E/S.

Lam Research had strong shipments and revenue performance in the September quarter, allowing the company to return to profitability and generate positive cash flow once again, Chief Executive Steve Newberry said in a statement.

Shares of the company rose $1.15 to $37 in trading after the bell. The stock, which has risen about 43 percent in last six months, closed at $35.85 Wednesday on Nasdaq.

(Reporting by Shrutika Verma in Bangalore; Editing by Pradeep Kurup and Saumyadeb Chakrabarty)