Updated from 4:17 p.m. EDT

Stocks rebounded from deep losses Friday to close near break-even and bring all three major stock indices into positive territory for a week that saw panic about the credit market roil the global financial system.

After being down more than 200 points on Friday morning, the Dow Jones Industrial Average closed down just 31.14 points, or 0.2%, to 13,238.54. The S&P 500 eked out a gain of 0.55 points to close at 1,453.64. The Nasdaq Composite shed 11.6 points, or 0.4%, to 2,544.89.

Stocks battled back in a volatile session with heavy trading volume after plunging on Thursday, but not until the Federal Reserve moved in by injecting $38 billion in liquidity into the system to keep rates from rising above its target level.

"The Fed accomplished what it wanted to accomplish today, but we're not out of the woods yet," says Paul Mendelsohn, chief investment strategist with Windham Financial Services. "There are still major jitters in this market and there are serious problems in the credit market that still need to be worked out, so who knows what will happen on Monday."

With more signs of liquidity problems emerging from a variety of financial institutions, investors are essentially running scared and blind in an extended period of trading volatility, since no one knows the real extent of the problems. But while the credit-market worries sent Wall Street reeling Thursday and Friday, a rally in the first three days of the week provided enough gains to keep the averages in the black.

The Dow finished the week up 0.4%, while the S&P 500 added 1.4% and the Nasdaq rose 1.3%. The turmoil had the Dow closing with swings of more than 100 points in three out of five sessions.

In all, the Fed injected $62 billion in liquidity into the system Thursday and Friday. The central bank also issued a statement saying it would provide reserves as necessary to keep federal funds rate as close as possible to its target rate of 5.25%.

"In current circumstances, depository institutions may experience unusual funding needs because of dislocations in money and credit markets," the Fed said. "As always, the discount window is available as a source of funding."

Bill Hampel, chief economist with the Credit Union National Association, said the Fed was acting prudently.

"Not all the debt out there is bad debt, but this mortgage scare has people treating everything like it's junk," said Hampel. "The banks have stopped doing anything while they do the sort of due diligence on these complex securities (mortgage-backed securities and other derivatives) that they should have been doing all along."

Hampel believes the Fed will likely issue a rate-cut soon, since the outlook on the U.S. economy is shifting. Last week, the central bank opted to hold rates steady, citing the risk of inflation as its chief concern.

"The risk of a recession has gone up, because there is a real possibility that these credit problems will have a spillover effect on consumer spending and the broader economy," Hampel said.

Fears were stoked in Friday's session as Countrywide ( CFC) said in a Securities and Exchange Commission filing that "unprecedented disruptions" in mortgage securities markets will take their toll on the company over the short-term. The country's largest independent mortgage lender said that if liquidity continues to tighten it would hurt its financial condition.

Also, Washington Mutual ( WM) contributed to concerns, noting in its own SEC filing that the problems in the subprime market has spread into other types of nonconforming mortgages. The bank said liquidity in the secondary market has "diminished significantly."

"This is more evidence that the credit problems are not isolated to subprime," said Arthur Hogan, chief market analyst with Jefferies. "This again reminds us that we don't know the extent to which the subprime mortgage and credit derivatives issues are going to spill over into other parts of the financial system."

Concerns about a spillover became an issue in the prior session, when a wave of fear swept over investors after French bank BNP Paribas said it has suspended three of its funds that have exposure to U.S. credit markets. That spurred concerns that liquidity problems in the U.S., caused by increasing problems in the mortgage markets, were spreading globally.

The Dow plunged 387 points-- its biggest one-day point loss since the 416-point drop Feb. 27. The S&P 500 shed 44 points and the Nasdaq dropped 56.

Foreign stocks also tumbled, and after providing $131 billion in loans during the previous session, the European Central Bank offered another $84 billion to the bank system overnight. Both the Japanese and Australian central banks said they would follow the same lead and add funds to the banking system.

Back in the U.S., Treasuries, viewed as a safe harbor in turbulent times, rallied. On Friday, the 10-year note finished up 9/32 in price, yielding 4.73%, and the 30-year bond surged 24/32, yielding 2.97%.

In economic news, the government said Friday that U.S. import prices rose for a fifth-straight month, raising the possibility that cheap imports may not continue to keep a lid on inflation in the future. Import prices jumped 1.5% in July, according to the Labor Department, beating expectations on Wall Street for a 1% increase. In June, import prices climbed 0.9%, revised down from the previously reported measure of 1%.

Among stocks, EchoStar ( DISH) posted a 33% rise in second-quarter earnings, meeting expectations on Wall Street. Shares rose 1.2%.

Nvidia ( NVDA) after the prior close said that its second-quarter profit doubled from a year ago, beating expectations. However, the chipmaker said there were supply constraints due to strong demand for its products, prompting a downgrade from Merrill Lynch. Shares of Nvidia fell 4.6%.

More from Markets

Ackman Investment Buoys Lowe's; DraftKings Responds to FanDuel Merger -- ICYMI

Ackman Investment Buoys Lowe's; DraftKings Responds to FanDuel Merger -- ICYMI

Replay: Jim Cramer on the Markets, Tiffany, Micron Technology and Union Pacific

Replay: Jim Cramer on the Markets, Tiffany, Micron Technology and Union Pacific

Carnival CEO Arnold Donald: China Will Become the Largest Cruise Market

Carnival CEO Arnold Donald: China Will Become the Largest Cruise Market

Red Robin Slumps After Earnings Miss

Red Robin Slumps After Earnings Miss

Owner of Moviepass Sees Stock Plummet

Owner of Moviepass Sees Stock Plummet