NEW YORK (CNNMoney.com) -- In its first big move to raise capital, Goldman Sachs Group announced Tuesday that it will receive a $5 billion infusion from Warren Buffett's Berkshire Hathaway, an investment that could also raise confidence in the venerable Wall Street firm and the financial markets in general.

The firm also increased its common stock offering Wednesday to $5 billion at $123 a share, an increase from the original $2.5 billion offering announced Tuesday evening.

Goldman (GS, Fortune 500) will sell $5 billion of preferred stock to the insurance and investment giant, which will also receive warrants to purchase $5 billion of common stock with a strike price of $115 per share, the company said. Berkshire (BRKA, Fortune 500) has five years to exercise the warrants. Buffett will be paid a 10% dividend on his shares.

Goldman shares rose 3.5% to about $129 in midday trading Wednesday.

The news that Buffett is now willing to invest in Wall Street could prove a big shot in the arm to the financial markets, which have been hammered by the year-long credit crisis.

"Goldman Sachs is an exceptional institution," said Buffett in a statement. "It has an unrivaled global franchise, a proven and deep management team and the intellectual and financial capital to continue its track record of outperformance."

Bailout a must

But the legendary investor said his faith in the financial markets' recovery is contingent on Congress passing the $700 billion bailout, which would buy troubled mortgage assets from banks.

"If I didn't think the government was going to act, I would not be doing anything this week," Buffett told CNBC Wednesday morning. "It would be a mistake to be buying anything now if the government was going to walk away from the Paulson proposal. Last week will look like Nirvana if they don't do something."

The move by Goldman marks the first major capital raising effort that the company has undertaken since the credit crunch erupted more than a year ago.

Facing devastating writedowns and painful losses, many of Goldman's peers have had to issue shares or sell an equity stake to outside investors.

But investors have shied away from doling out dough to other firms, with devastating consequences. Lehman Brothers (LEH, Fortune 500) was forced into bankruptcy last week, while the federal government had to give an $85 billion loan to insurance titan American International Group (AIG, Fortune 500) to prevent its collapse.

Goldman is now using its relative position of strength to boost its capital levels and mollify investors and regulators.

"This investment will further bolster or strong capitalization and liquidity position," said Lloyd Blankfein, Goldman's chief executive.

By having a conservative and heralded investor like Buffett back Goldman, it signals his faith in the company, analysts said.

"It's a vote of confidence in Goldman," said Nancy A. Bush, founder of NAB Research. "I can't imagine something better than the good housekeeping seal of approval."

With Buffett backing the company, investors are more likely to scoop up shares, said James Ellman, head of San Francisco-based Seacliff Capital, a hedge fund specializing in financial services.

"If you invest alongside Warren, you tend to make a lot of money," he said.

The more capital, the better

While Goldman is already well-capitalized, raising more cash would ease investors' concerns about its relatively high leverage ratio. Investment banks use leverage, or borrowed money, to boost returns.

The investment bank can use the money to scoop up smaller banks at cheap prices, analysts said.

Raising capital will "provide the firm with dry powder for distressed investment opportunities," said Patrick Pinschmidt, a Morgan Stanley analyst.

The announcement follows what has been a tumultuous time on Wall Street.

Late Sunday, both Goldman and Morgan Stanley (MS, Fortune 500) were converted into bank holding companies by federal regulators, effectively closing the book on the stand-alone investment bank business model.

By becoming banks, the firms are subject to greater scrutiny by federal regulators and are required to have more capital and take fewer risks than they did as investment banks.

Just a day earlier, Morgan agreed to sell up to a fifth of the company to Mitsubishi UFJ Financial Group, one of Japan's largest banks.

Last week, Merrill Lynch (MER, Fortune 500) was acquired by Bank of America (BAC, Fortune 500).

Additional reporting on this story by CNNMoney.com's David Ellis