Stocks rose Monday as an upbeat earnings report from consumer products giant Procter & Gamble offset investors' worries over oil prices and warnings of a possible Al Qaeda terror attack on U.S. financial institutions.

The Dow Jones industrial average (searchwas up 40.55 points, or 0.40 percent, at 10,180.26. The Standard & Poor's 500 Index (searchwas up 4.98 points, or 0.45 percent, at 1,106.70. The technology-laced Nasdaq Composite Index (searchwas up 4.73 points, or 0.25 percent, at 1,892.09.

Citigroup Inc. (C), Prudential Financial (PRU), the International Monetary Fund, the New York Stock Exchange and the World Bank were included in a "high" level threat alert issued by the U.S. Department of Homeland Security Sunday.

The warnings about the possible attacks depressed stocks earlier in the session but as the day progressed, investors shrugged off some of their fears.

"It opened lower because some people took to heart what was said," said Stanley Nabi, vice chairman at Silvercrest Asset Management Group. "Then once the moderate selling as a result of this kind of psychological turning point was over, the market started gathering a little bit of momentum."

The warnings drove U.S. crude oil prices to a record high of $43.94 a barrel earlier in the day before prices eased a bit to settle Monday at $43.82, up 2 cents. As a vital ingredient for transport as well as the production of most goods and services, high oil prices tend to hurt corporate profits and can ripple through the economy.

Technology stocks hovered slightly below the unchanged mark as fears about the attacks and a drop in education stocks weighed.

In a bid to reassure investors, New York Mayor Michael Bloomberg and Gov. George Pataki rang the opening bell Monday on the NYSE and urged the financial community to go about its business.

Sam Stovall, chief investment strategist at Standard & Poor's, said concerns about terrorism, along with high oil prices and uncertainty about the economy, have been part of what investors are calling Wall Street's "wall of worry."

"And it's not just everyday terrorism concerns. It's linked to the conventions, the Olympics," Stovall said. "How do you factor in an unknown event?"

Even amid the new terror concerns, a strong earnings report from leading consumer products maker Procter & Gamble helped provide an underpinning for enthusiasm on the market.

The market also digested two economic reports that came out Monday morning, a surprise 0.3 percent decline in construction spending in June, and a July manufacturing survey from the Institute for Supply Management (search) that, while upbeat overall, signaled declines in its measures of employment and prices.

"The ISM survey was, as expected, strong but the prices paid part of it was up less dramatically than people expected and that takes some of the edge off of the inflation fears," said Milton Ezrati, senior economic strategist at Lord Abbett & Co. "It not only relieved that fear in the market to an extent, but it also relieves the fear that the Fed is going to have to tighten (interest rates) too much. And that has been something that has worried the market for some time now."

Financial stocks were somewhat lower amid the threat of terrorism against financial institutions. Prudential, whose Newark, N.J., building was cited as a possible target, was down 76 cents at $45.80. But shares in Citigroup were up 22 cents at $44.31 after being lower earlier.

Dow component Procter & Gamble (PG), a maker of Tide laundry detergent and dozens of other household and personal products, reported a better-than-expected quarterly profit. The company's stock rose $1.25, or 2 percent, to $53.40 on the New York Stock Exchange.

Wireless technology provider Qualcomm Inc. (QCOM) helped boost the Nasdaq after Banc of America Securities upgraded its rating on the stock to "buy" from "neutral." Qualcomm gained $2.85, or 4.1 percent, to $72.06.

Shares of Cox Communications Inc. (COX), the nation's fourth-largest cable TV provider, soared $5.83 or 21 percent to $33.41 after its Atlanta-based parent company Cox Enterprises Inc. announced a $7.9 billion proposal to buy all outstanding shares and take the company private.

Shares in other cable companies also rose. Industry leader Comcast Corp. (CMCSA) was up $1.22 at $28.02, and Cablevision Systems Corp. surged $2.06 to $19.53.

But education stocks took a hit, keeping the Nasdaq in negative territory until it edged up in afternoon trade, after Corinthian Colleges Inc. lowered its quarterly earnings forecast. Corinthian Colleges (COCO) plunged $8.43, or 45 percent, to $10.29 on the Nasdaq. Apollo Group Inc. (APOL) fell $6.22 or 7.4 percent, to $77.33 on the Nasdaq. Career Education Group (CECO) tumbled $4.21, or 12.5 percent, to $29.60 on the Nasdaq.

The Russell 2000 index of smaller companies edged up 0.64 or 0.1 percent at 551.93.

Overseas, Japan's Nikkei stock average fell 0.9 percent. In afternoon trading, Britain's FTSE 100 was up 0.06 percent, Germany's DAX index was down 0.8 percent, and France's CAC-40 was down 0.6 percent.

Reuters and the Associated Press contributed to this report.