Stocks rose on Tuesday as oil prices topped $97 a barrel and lifted shares of Exxon Mobil Corp and other energy producers, while optimism a day ahead of Cisco Systems Inc earnings drove another rally in technology shares.

Investors hunted for bargains among beaten-down bank and financial services shares after the previous session's sell-off left the sector near two-year lows. JPMorgan Chase & Co rose 3.1 percent to $44.11 and ranked among the Dow's leading gainers. Insurer American International Group was up 4.2 percent at $62.05 ahead of earnings on Wednesday and gave the Dow its second-biggest boost.

Web search company Google Inc, whose price target was raised to $850 by broker research firm Sanford C. Bernstein, advanced to $741.79, another lifetime high.

Technology is our preferred play on the global economy, said David Bianco, chief U.S. equity strategist at UBS in New York. The weaker dollar is making a lot of the IT infrastructure products more affordable.

Crude oil futures rose more than $3 to a record $97.10 a barrel on a weaker dollar and supply concerns, and many investors anticipated it could soon surpass $100. Exxon Mobil led advancers in both the blue-chip Dow average and the S&P.

The Dow Jones industrial average was up 117.54 points, or 0.87 percent, at 13,660.94. The Standard & Poor's 500 Index was up 18.10 points, or 1.20 percent, at 1,520.27. The Nasdaq Composite Index was up 30.00 points, or 1.07 percent, at 2,825.18.

Exxon Mobil was up 3.1 percent at $90.38.

U.S. crude oil for December delivery gained $2.72 to settle at $96.70 a barrel on the New York Mercantile Exchange.

Cisco shares had their best percentage gain since August, when the maker of routers and other network equipment last reported earnings. In Tuesday's session, Cisco's stock rose 3 percent to end at $34.08 on the Nasdaq. Its quarterly results are due for release on Wednesday after the closing bell.

Google, which has said it is planning to offer a software system to make the Internet work as smoothly on mobile phones as it does on computers, gained 2.2 percent, or $16.14, to close at a record $741.79 on Nasdaq.

Also in the tech sector, shares of Research In Motion Ltd gained 2.4 percent to $131.04 after Credit Suisse raised its rating on the stock.

The S&P financial index rose 1.7 percent, snapping a three-day skid that had taken it to a two-year low. The index had fallen 7.5 percent during the slide, its worst drubbing over a similar stretch in five years.

Goldman Sachs Group Inc gained 2.2 percent to $233.16. The investment bank repeated that market rumors that it may have to write down mortgage-related losses are still untrue.

My feeling yesterday was that the bad credit market news reached a crescendo with Citigroup, said Al Goldman, chief market strategist at A.G. Edwards in St. Louis.

Shares of Citigroup Inc, the largest U.S. bank, extended losses from Monday that followed the company's warning of as much as $11 billion more in loan losses and the departure of Chief Executive Charles Prince. Citigroup fell 2.3 percent to $35.08 on the New York Stock Exchange.

Trading was below average on the NYSE, with about 1.50 billion shares changing hands, below last year's estimated daily average of 1.84 billion. On Nasdaq, about 2.53 billion shares traded, ahead of last year's daily average of 2.02 billion.

Advancing stocks outnumbered declining ones by a ratio of about 2 to 1 on the NYSE and about 4 to 3 on Nasdaq.

(Additional reporting by Ellis Mnyandu)