Stocks closed higher as optimism prevailed, even in the face of $122-a-barrel oil. Techs got a boost from speculation that a deal between Microsoft and Yahoo is still possible.
The Dow Jones Industrial Average rose 0.4 percent, closing above 13000 for the second time in a week.
The Nasdaq and S&P 500 indexes each gained 0.8 percent, finishing at their highest respective levels in four months.
The CBOE Volatility Index, considered the best gauge of fear in the market, is now at its lowest level since October.
Crude oiljumped over the $122 mark-- before settling at a record $121.84 a barrel. Traders say the next benchmark is $150 and Goldman Sachs -- oh yes they did -- went there, saying oil could reach $200 a barrel.
Among 10 key S&P sector indexes, energy was the big winner, climbing 2.1 percent, followed by materials and IT, which gained 1 percent each, and financials, which rose 0.9 percent.
Traders said some of the day's gains could be attributed to optimism about the second half.
"The consensus ... out there is that the worst is over, when it comes to what was driving market down in the first place (credit crisis, subprime, etc.)," said Nadav Baum, managing director at BPU Investment Group in Pittsburgh. "The market isn't looking in the rear-view mirror, the market is looking ahead," he said.
Still, not everyone was convinced that the worst is over.
"On the floor, there's a feeling that the consumer may have hit a wall about three weeks ago," Art Cashin, director of floor operations at UBS, told CNBC. "How much it costs to fill up the tank ... how they're seeing signs of cutbacks ... that's all anecdotal to what starts to show up in the numbers."
"If oil stays where it is, it's got to damp consumer spending," Baum said. "But markets don't make mistakes. ... So, if the market is digesting all of this and saying 'the worst is over' then, obviously, the market thinks oil's got to come back down," he added.
Alcoa rose 3 percent, making it the top gainer on the Dow. Microsoft . and AIG tied for second, with gains of 2.1 percent each.
Anadarko shares shot up 9.4 percent, helped by crude prices and after the independent exploration and production company late Monday posted better-than-expected earnings and issued a healthy forecast.
Yahoo shares rebounded more than 5.5 percent -- after Monday's 15-percent drop -- as shareholders latched on to the possibility that a deal with Microsoft could still happen.
"It seems like the shareholders are going to try to make something happen, but the stock is acting like that's real," Bobby Harrington, head of block trading at UBS, told Reuters.
In an interview, Yahoo President Sue Decker said part of the problem with the breakdown in negotiations was that Microsoft never put its $33 a share offer in writing.
Meanwhile, MicrosoftChairman Bill Gates said Tuesday that the software gianthasn't ruled out partnerships with other companiessince the Yahoo deal went bust but nothing is imminent.
Shares of Fannie Maefinished up 8.9 percent, helped by short covering, after the housing lender assuaged investor concerns in a conference call, saying it plans to raise $6 billion in capital and is improving shareholder value.
"Right now, we are in the belly of this cycle," Daniel Mudd, Fannie Mae's chief executive, said on the conference call. "The initial period of [disruption] in the marketplace appears to be dissipating. The capital markets are recovering balance."
Earlier, Fannie Mae reported its third straight quarterly loss and lowered its common stock dividend, projecting that credit losses will stretch into 2009.
Swiss bank UBS said it plans to cut 5,500 jobs in one of the biggest purges so far in this financial-market crisis. The company also announced a preliminary deal with U.S. asset manager BlackRock to sell $15 billion in subprime mortgages.
A day earlier, U.S. brokerage firm Morgan Stanley announced its planning another round of layoffs, finalizing a plan to reduce its workforce by another 5 percent. It's part of the next wave of layoffs headed for Wall Street, with cuts in the works at both JPMorgan Chase and Lehman Brothers , CNBC has learned.
Also Monday, Merck said it was paring its sales force by 1,200 jobsfollowing the FDA rejection of Merck's new cholesterol drug, Cordaptive.
Target announced plans to sell a 47-percent stake in its credit-card businessto JPMorgan Chase for $3.6 billion. The discount retailer said this was a dream deal with a dream partner. According to terms of the deal, Target will still run the unit and get a cash infusion, while JPMorgan has the rights to future profits.
"We expect to get hundreds of millions of dollars from profit from this venture unless we really screw it up," Target CFO Doug Scovanner said of the JPMorgan deal during a conference call with analysts. "Personally, I think this is what Dire Straits had in mind in the 1980s anthem, 'Money for Nothing.' I think this is wonderful."
Legg Mason shares skidded more than 10 percent after the money manager posted its first-ever lossamid a hefty charge related to a bailout of money-market funds exposed to risky securities.
Yum Brands , which operates fast-food chains including Taco Bell, KFC and Pizza Hut, said it will raise its quarterly dividend to 19 cents from 15 cents.
On the earnings front, Disney and Cisco Systems reported after the closing bell. Cisco's profit fell 5.4 percent but beat expectations, as revenue climbed 10 percent. Disney also surpassed forecasts, reporting its net rose 22 percent. Both stocks gained more than 2 percent in after-hours trading.
TUESDAY: Indiana, North Carolina primaries
WEDNESDAY: Mortgage applications; Productivity; Pending home sales; Crude inventories; Consumer credit; Earnings from News Corp., Transocean
THURSDAY: Retail same-store sales; Jobless claims; Wholesale trade; Cablevision earnings
FRIDAY: Trade report
Send comments to email@example.com.