Updated from 3:12 p.m. EDT

U.S. stocks edged off their highs but still closed with substantial gains Wednesday as an encouraging report on durable goods orders helped quell fears of a backsliding economy even as oil prices ticked higher.

The

Dow Jones Industrial Average

climbed 89.64 points, or 0.8%, to 11,502.51, while the

S&P 500

gained 10.15 points, or 0.8%, to 1281.66. The

Nasdaq

rose 20.49 points, or 0.9%, to 2382.46.

Traders appeared to take heart from the Census Bureau's read on durable goods. The agency said orders rose 1.3% in July, well ahead of economists' forecasts for zero growth. Excluding transportation-related products, the figure increased 0.7%, whereas analysts were expecting a 0.7% decline.

"Durable goods orders increased more than expected in July, but the increase may have more to do with special factors than any improvement in underlying trends in the economy," wrote Tony Crescenzi, chief bond market strategist at Miller Tabak and contributor to

TheStreet.com's

sister site,

RealMoney.com

. Crescenzi wrote that the boost in goods orders factors in price increases in primary metals, an increase not reflected in the Census Bureau's data.

Furthermore, Crescenzi wrote, the Economic Stimulus Act of 2008 was probably responsible for an increase of about $1.4 billion in machinery orders, as the law gave companies additional depreciation on equipment bought in 2008 and increased small businesses' expensing limits. Crescenzi also noted that capital expenditures may be a sign that businesses are trying to improve efficiency and thus rein in costs.

In the previous trading session, stocks traded in choppy fashion to rise in the final hour and close Tuesday narrowly mixed. The Federal Deposit Insurance Corp. reported Tuesday that the banks and thrifts it insures recorded markedly low earnings in the most recent quarter and the number of banks on its so-called

problem list

jumped 30%.

Before the start of the new day's trading, a

Wall Street Journal

Report said FDIC chairwoman Sheila Bair said her agency may need to take a line of credit with the Treasury to help with its short-term capital levels as it copes with an increasing probability of more bank failures.

Separately, the Federal Housing Administration said it would increase the price of its insurance of mortgages to 1.75% of the loan amount from 1.5%. The new rate takes effect on Oct. 1. And early Wednesday the Mortgage Bankers Association reported a week-over-week rise of 0.5% in mortgage applications for the week ended Aug. 22.

Following Tuesday's close, Standard & Poor's downgraded its ratings on

Fannie Mae

( FNM) preferred stock and credit. The government-sponsored mortgage company and its sister,

Freddie Mac

( FRE) have contributed substantially to recent market angst as traders have weighed the possibility that the pair faces a government takeover.

Economists at Societe Generale offered a hint as to the extent the financial sector's exposure to Fannie and Freddie, estimating that U.S. commercial banks own $1 trillion in debt from Fannie or Freddie, a figure that amounts to 9% of the commercial banks' balance sheets.

Several pieces of news appeared to brighten prospects for the twin agencies.

Bloomberg

reported that Fannie and Freddie's profit from new investments is at 10-year highs, easing the possibility that the Treasury will need to nationalize them. Fannie rose 15% to $6.48, and Freddie was up 20% to $4.75.

"Margin-wise, they're as good as they've ever been," said Kenny Landgraf, president and chief investment officer at Kenjol Capital Management. He said that the loans already on Fannie and Freddie's books are the source of trouble. "You've got these outsiders saying, 'Well, they're undercapitalized and they're essentially bankrupt.'" He said that when institutions are leveraged as heavily as Fannie and Freddie, it doesn't take a lot to cause a crisis of confidence.

Also bolstering confidence was a successful sale of $3 billion in short-term Fannie and Freddie bonds, suggesting the companies can still raise money in the private sector.

Meanwhile, the

Financial Times

reported that pummeled brokerage

Lehman Brothers

( LEH) has three private equity firms in contention to buy its asset-management segment. Lehman shares gained 5.4% to $14.78.

Another troubled financial institution,

BankUnited

( BKUNA), which faces pressure from federal regulators to raise $400 million in capital,

lost ground

after catching a Stifel Nicolaus downgrade to sell from hold. Shares fell 19% to $1.16.

Outside the financials,

Ikon Office Solutions

( IKN) said its supplier, Japan's Ricoh, would buy the office-machinery supplier for $1.62 billion, or $17.25 a share, well above Ikon's Tuesday closing price of $15.56. Shares rose 9.4% to $17.02.

Integrated oil company

ConocoPhillips

(COP) - Get Report

looks ready to sell the rest of its gas stations to PetroSun West for $800 million, according to a report in the

Journal

. The stock climbed 1.3% to $83.47.

In a move that stands to impact the broad market, the

Securities and Exchange Commission

said it plans to implement international accounting rules by 2014. SEC Chairman Christopher Cox said the new rules would improve transparency in the market.

The Energy Information Administration announced that crude-oil inventories declined by 177,000 barrels. Gasoline inventories also decreased slightly. Unease about supply has recently increased as Tropical Storm Gustav menaces oil production in the Gulf of Mexico.

Crude oil settled up $1.88 at $118.15 a barrel. Gold rose $5.90 to finish at $834.

Longer-dated U.S. Treasuries were recently ticking higher. The 10-year was up 3/32 in price to yield 3.76%, and the 30-year was 2/32 higher, yielding 4.38%. The dollar was softening vs. the euro but gaining on the yen and the pound.

Foreign markets were uneven. The FTSE in London and the Hang Seng in Hong Kong were gaining ground, while the Dax in Frankfurt and the Nikkei in Japan were edging lower.