MGM, which is considering a public offering of its stock, has posted second-quarter earnings of $42.1 million, or nearly four times the $12.2 million in earnings in the 2011 quarter.

The privately held studio, in a report on its website, disclosed that earnings were lifted by a one-time $55.7 million gain on sale of part of its TV assets.

MGM said revenue declined, as expected to $128.4 million from $195.4 million.

“Lower revenue in the current year’s second quarter against the prior year was due to several factors, including the lack of revenue from new release content moving through initial television windows, the sale of ‘The Cabin in the Woods’ during the prior year’s second quarter, the continuing decline in the physical home entertainment market and a strategic moratorium we imposed on new DVD shipments for James Bond franchise titles,” MGM said. “However, we believe revenue will significantly increase above current levels beginning in the 2012 fourth quarter when we release ‘Skyfall’ and ‘The Hobbit: An Unexpected Journey.'”

MGM also disclosed in the report that it had bought back Carl Icahn’s holdings, though it did not identify Icahn, via an agreement with “a stockholder” to repurchase a total of 17.62 million shares of our Class A common stock at a price of $33.50 per share for a total of $590.4 million to be paid Wednesday.

The agreement effectively divests the activist investor of all Hollywood holdings, 11 months after Icahn decided to cash out his Lionsgate holdings for $309 million.

MGM disclosed last month in a filing with the Securities and Exchange Commission that it was considering an IPO under new legislation effective in April that allows companies with under $1 billion in revenue to keep the process confidential until 21 days before a roadshow.

MGM said in the filing that second quarter worldwide TV licensing revenue was $70.9 million, down from $94.9 million, primarily due to a lack of new releases.