Giant steel maker Nucor Corp. swung to a profit in the fourth quarter, beating expectations as increased production and higher selling prices boosted profit 25 percent, the Charlotte, N.C.-based company said Thursday.

The nation's largest steelmaker by production, Nucor (NYSE: NUE) earned $137.1 million, or 43 cents per share, in the fourth quarter of 2011 compared with a loss of $11.4 million, or four cents per share, in the year-earlier quarter.

Revenue in the fourth quarter of 2011 rose to $4.83 billion, up from $3.85 billion in the same quarter last year.

The company faced bearish predictions about its fourth quarter 2011 results because of declining selling prices for steel and rising costs for scrap and scrap substitutes, which Nucor uses to make steel. Those input costs jumped 23 percent in the fourth quarter of last year from the 2010 fourth quarter. But the company overcame the challenge on an 18 percent increase in the price per ton of steel coupled with a seven percent increase in the amount shipped.

Nucor anticipates the 2012 first-quarter earnings to continue an upward trend, which has seen the steel maker report three consecutive quarters of profits. Analysts are expecting earnings to reach 70 cents per share in the first quarter of 2012, according to Thompson Reuters I/B/E/S estimates.

Shares were $44.245 in late afternoon trading.