U.S. stocks were little changed Thursday as some investors opted to lock in profits following the market's record run-up, tempering optimism from news of a $6.8 billion proposed takeover in the financial sector.

Wachovia Corp.'s (WB) proposed takeover of A.G. Edwards Inc. (AGE).

sent shares of brokerages up, while a pullback in oil prices weighed on shares of energy companies such as Exxon Mobil Corp. (XOM), putting a lid on the major gauges.

Even so, U.S. stocks were on course for their biggest May advance in four years, a day after the S&P 500 closed at a new record for the first time in seven years.

Analysts said the market was due to consolidate recent gains.

"It's a natural consequence of markets that are near all-time highs to think, 'Gee, it can't go any higher,"' said Ernie Ankrim, chief investment strategist for Russell Investment Group, in Tacoma, Washington.

"So the probabilities of any dramatic advances over the next two months (following the recent run-up) are likely smaller, but on the other hand, if you think about alternative to equities, I'm not sure you'd do a lot better trading out of equity positions here and changing the risk profile of your portfolio."

The Dow Jones industrial average was up 2.93 points, or 0.02 percent, at 13,636.01. The Standard & Poor's 500 Index was up 0.80 of a point, or 0.05 percent, at 1,531.03. The Nasdaq Composite Index was up 6.34 points, or 0.24 percent, at 2,598.93.

Wachovia, the fourth-largest U.S. bank, said it planned to buy brokerage A.G. Edwards for about $6.8 billion in cash and stock to create the second-largest retail brokerage in the United States.

Shares of A.G. Edwards jumped 13.7 percent to $87.70 on the New York Stock Exchange, while the AMEX Securities broker dealer index rose 2.7 percent. Shares of Raymond James Financial Inc.

surged 8.2 percent.

Wachovia shares slipped 0.7 percent to $54.18 on the NYSE.

Although the pullback in crude oil prices helped shares of big manufacturers such as United Technologies Corp., it hurt shares of energy companies. Exxon's stock dropped 0.4 percent to $83.69.

U.S. crude for July delivery was up 21 cents at $63.70 a barrel, off a session high at $63.97 in New York trading.

UTX (UTX) shares gained 1.5 percent to $70.44 on the NYSE. The stock was the Dow's biggest advancer. Data showing a stronger-than-expected reading in the Chicago purchasing managers' index, a gauge of Midwest manufacturing activity, also lent support.

On the Nasdaq, shares of Apple Inc. (AAPL) climbed 2.1 percent to $121.25, extending gains from Wednesday when positive brokerage comments on the stock boosted Apple.