Goldman Sachs Group Inc will buy back $5 billion of preferred stock from Warren Buffett, ending a costly deal that helped shore up confidence in the bank at the height of the financial crisis.

The buyback has been expected for some time, given the relatively unfavorable terms for the investment bank, which paid Buffett's Berkshire Hathaway Inc $500 million a year in dividends, or more than $15 a second,

The firm is paying a 10 percent premium to buy back the shares. It will take a $1.6 billion hit to first-quarter earnings, including the premium. Repurchase terms were agreed in September 2008, when the deal was struck.

The transaction is expected to reduce reported earnings per share for the first quarter by about $2.80, plus another 4 cents for accelerated dividends. Certain financial details were outlined earlier in the firm's 10-K report.

Berkshire Hathaway's 2008 investment in Goldman Sachs was a major vote of confidence in our firm and we are very appreciative of it, Goldman said in a statement.

The trade signaled Buffett's belief that Goldman would survive the financial crisis and the firm had to pay handsomely for Buffett's seal of approval.

Credit Suisse analyst Howard Chen says the repurchase stands to lift Goldman's earnings on an ongoing basis by 4 percent per year and boost return on equity by 80 basis points.

It was a great nod of confidence for the franchise during a more challenging time, but it is an expensive form of regulatory capital, says Chen.

Buffett lamented the likely redemption of the shares in his annual letter to shareholders last month.

Goldman Sachs has the right to call our preferred on 30 days notice, but has been held back by the Federal Reserve (bless it!), which unfortunately will likely give Goldman the green light before long, he wrote in the letter.

Berkshire will continue to hold a warrant to purchase nearly 43.5 million shares of Goldman stock, which it bought at the same time as the preferred shares.

Goldman said it received approval for the buyback from the Federal Reserve, which also cleared Goldman's plans to potentially buy back stock and raise its common stock dividend this year.

The Federal Reserve also approved dividend actions at other major banks that passed the latest round of stress tests, loosening the reins on the banking industry 2-1/2 years after the government bailed out the financial system.

Chen says a dividend rise is not totally off the table, but he views it as a low priority for Goldman, which has historically favored stock repurchases over dividend raises.

Goldman never cut its dividend during the financial crisis so if this is a dividend restoration exercise, then they have nothing to restore, said Chen.

The Buffett transaction also grants Berkshire warrants to purchase 43.5 million common shares at $115 per share through 2013.

Goldman shares rose 2.7 percent to close at $159.96 on the New York Stock Exchange. Berkshire's class A shares advanced 0.5 percent to $124,700, and its class B shares rose 0.9 percent to $83.48.

The preferred shares carried an annual dividend of 10 percent, meaning that buying back the securities will save the investment bank about $500 million a year. The annual dividend to Berkshire translated into $1.4 million per day, $951.29 per minute and $15.85 per second.

Buffett also invested $3 billion in General Electric Co preferred stock with similar terms in 2008. GE Chief Executive Jeffrey Immelt has said he would like to retire the stock as soon as possible, perhaps some time this year.

A spokeswoman for GE did not immediately respond to questions about when the company might redeem the stock, which costs GE about $300 million each year.

Retiring the Buffett stock now will also allow top Goldman executives to sell more stock more quickly, if they choose to.

As part of the deal, Chairman and Chief Executive Lloyd Blankfein, Chief Financial Officer David Viniar and Chief Operating Officer Gary Cohn agreed to limit their sales of Goldman Sachs common stock to 10 percent of total holdings. The agreement lasted either until Goldman repurchased Buffett's preferred stake or until October 1, 2011.

Outside of that agreement, the executives must retain at least 75 percent of their stock holdings as long as they remain in their positions.

As of March 8, 2010, those three executives held 7.3 million common shares, according to the most recent Goldman proxy statement. Each received an additional 78,111 restricted units for their performance in 2010, according to recent regulatory filings.

(Reporting by Ben Berkowitz and Lauren Tara LaCapra; Additional reporting by Dan Wilchins; Editing by Steve Orlofsky, Gunna Dickson, Richard Chang and Andre Grenon)