When Bank of America Corp agreed to sell $5 billion of preferred shares to Warren Buffett, it gave the Oracle of Omaha a $3 billion gift with the deal.

The 700 million warrants attached to the preferred share sale were worth $3.17 billion when the deal was crafted, said Linus Wilson, an assistant professor of finance at the University of Louisiana at Lafayette.

That value rose in the hours after the preferred share sale was announced publicly, as Bank of America's share price jumped. By the close of trading, the warrants were worth $3.5 billion, Wilson said. Bank of America's shares rose to $7.65 from $6.99 the day before, but traded as high as $8.79 in Thursday's session.

The fact that Bank of America was willing to give away these warrants to sweeten the deal for Buffett's Berkshire Hathaway signals how keen the bank was for Buffett's money, analysts said.

It's very nice of Mr. Buffett to throw $5 billion into this but we're talking about hundreds of billions in potential losses related to mortgage litigation, said Christopher Whalen, a managing director at Institutional Risk Analytics who analyzes bank stocks.

It doesn't really move the needle as far as my concern, he said. If Warren had written a check for $50 billion, I might have paid attention.

Warrants are essentially options, offering an investor the right to purchase a security within a designated period of time at a particular price.

In the case of Bank of America, it gave Buffett the right to buy 700 million shares for $7.142857 apiece any time over the next 10 years.

The value of an option reflects both its intrinsic value, or the extent to which it can be exercised at a profit now, as well as its time value, or the extent to which exercising the option may be even more profitable in the future because the shares may rise from current levels.

The warrants were just part of the Buffett deal, the other part being an annual dividend of 6 percent on the $5 billion of preferred shares. That represents $300 million per year, or $75 million per quarter, until Bank of America redeems the stock.

The securities never mature, but the bank has the option to buy them back at 5 percent more than their face value any time. They were worth about $4.46 billion when the deal was put together, according to Wilson, and closed at about $4.47 billion after the announcement, which broadly lifted the market value of the bank's securities.

Adding together the warrants and the preferreds, Buffett's paper profit rose to $2.97 billion on the deal, from $2.63 billion when the transaction was announced.

The Bank of America warrants are worth more than three times as much as the warrants Buffett got from Goldman Sachs Group Inc in 2008, according to Wilson's analysis.

But Jon Najarian, co-founder of options trading firm optionMONSTER, points out that just slight moves in the market can cause large swings in relative option values.

(Reporting by Lauren Tara LaCapra; editing by Andre Grenon, Dan Wilchins and Matthew Lewis)