NEW YORK — Wall Street ended a mildly erratic day slightly lower Thursday after anxiety about widening credit problems offset investor optimism about a $2 billion capital infusion into troubled mortgage lender Countrywide Financial Corp.

The market gave up a moderate early gain, but fluctuations were to be expected given the amount of uncertainty about the credit markets, and the fact that stocks posted big gains Wednesday, pushing the Dow Jones industrials up 145 points.

Bank of America Corp. announced late Wednesday it will invest the money into the nation's largest mortgage lender to help it better weather problems with defaulting subprime loans. The investment was seen as a way to not only prop up Countrywide, but also prevent any further losses at the mortgage lender from hurting the underlying economy. Countrywide's CEO Angelo Mozilo expressed his optimism about the deal in an interview on CNBC on Thursday, but when asked if the housing slump could cause a recession, he agreed.

The market will likely be trading nervously "until we get some clarity from the Fed," said Jim Herrick, manager and director of equity trading at Baird & Co.

The Federal Reserve's moves to ease the market's credit concerns, including cash injections into the banking system and a lower discount lending rate to banks, have had some palliative effect on Wall Street, evidenced by the ebbing of the extreme volatility of recent weeks. But regarding the Fed's moves and Bank of America's investment in Countrywide, "some would argue that this is a Band-Aid approach to a bigger problem ... The big unknown is how widespread this problem is," Herrick said.

The Countrywide CEO's comments "probably didn't help" the market, he said. "They're the biggest lender in America."

The market showed little response Thursday to policymakers' infusion of another $17.25 billion into the banking system to help boost liquidity, adding to the $41.25 billion the central bank has injected since the beginning of last week.

According to preliminary calculations, the Dow fell 0.25, or less than 0.01 percent, to 13,235.88.

Broader indexes fell modestly. The Standard & Poor's 500 index lost 1.57, or 0.11 percent, closing at 1,462.50, and the Nasdaq composite index fell 11.10, or 0.43 percent, to 2,541.70.

The Russell 2000 index of smaller companies fell 10.31, or 1.29 percent, to 788.25.

Though the major stock indexes finished a bit lower, advancing issues narrowly outnumbered decliners on the New York Stock Exchange. Volume came to a light 1.38 billion shares, down from 1.45 billion Wednesday.

Crude oil rose 57 cents to settle at $69.83 a barrel on the New York Mercantile Exchange. Gold dipped slightly, and the dollar was mixed against other major currencies.

Though Bank of America's move was reassuring to investors, a number of major banks and home lenders still face difficulties. On Wednesday, Lehman Brothers Holdings Inc. said it would close its BNC Mortgage unit and slash 1,200 jobs; HSBC Holdings PLC and Accredited Home Lenders Holding Co. also said they would eliminate jobs.

"Moving up or down a little is OK because I think investors need some time to digest all the news out there, and they are still really hoping the Federal Reserve will lower interest rates," said Neil Massa, equity trader at John Hancock Funds. "You're not seeing the rush to sell, nor the panic buying, that we've had before."

The Fed's cut last Friday of the discount rate, the interest it charges banks to borrow, did little to alleviate concern about distressed subprime mortgages and a difficult credit environment, although it did remove some of the volatility that has torn the stock market over the past month. Investors are hoping the Fed will take the more dramatic step of lowering its benchmark federal funds rate.

Analysts say the markets are expected to be somewhat choppy until Wall Street gets a clearer picture about the Fed's intentions when it meets on Sept. 18.

Five banks have said they responded to the discount rate cut by borrowing from the Fed. Borrowing money from the central bank is usually seen as a negative action by banks, but the move was designed to bolster the financial system. The weekly Fed report on bank borrowing from what's known as its discount window will be released later in the afternoon, giving more insight into other banks that have participated.

The Bank of America deal, which could ultimately give the bank a 16 percent stake in Countrywide, was viewed as a sign that U.S. financial companies are willing to step in. Last week, Countrywide borrowed about $12 billion from U.S. banks to keep it going.

Bank of America shares rose 23 cents to $51.88, while Countrywide rose 20 cents to $22.02, paring earlier gains.

But Wall Street is still worried that commercial paper, bonds that companies sell to get quick cash, has become harder to sell. The total amount of commercial paper outstanding fell for the second week in a row to $2.042 trillion in the week ended Wednesday, the Fed said, down $90.2 billion from the previous week.

Most of that loss was in asset-backed commercial paper, much of which is mortgage-backed. Asset-backed commercial paper fell $77.1 billion to $1.057 trillion, meaning that 6.8 percent of companies' commercial paper couldn't be rolled over.

Britain's FTSE 100 rose 0.01 percent, Germany's DAX index rose 0.15 percent, and France's CAC-40 rose 0.09 percent. In Asia, Japan's Nikkei stock average closed up 2.61 percent, and Hong Kong's Hang Seng Index rose 2.77 percent.

On the Net:

New York Stock Exchange:

Nasdaq Stock Market: