Stocks rose sharply on Tuesday after Australia became the first G20 country to raise rates since the onset of the financial crisis, and on optimism for a strong U.S. earnings season.

The Australian rate hike was taken as a signal the global economy was coming back. Equities were also lifted by gains in commodity prices as the U.S. dollar fell against a basket of currencies.

Shares in the basic materials sector led the way, with Alcoa Inc gaining 4.1 percent to $13.97. Dow component Alcoa, will announce quarterly results on Wednesday, kicking off the earnings season. Analysts were optimistic that quarterly revenues will be broadly stronger.

The Dow Jones industrial average <.DJI> was up 156.59 points, or 1.63 percent, at 9,756.34. The Standard & Poor's 500 Index <.SPX> rose 18.19 points, or 1.75 percent, at 1,058.65. The Nasdaq Composite Index <.IXIC> jumped 40.24 points, or 1.95 percent, at 2,108.39.

I'm encouraged a commodity-exporting country is sensing enough economic activity to raise rates, said Jack Ablin, chief investment officer at Harris Private Bank in Chicago.

Australia's central bank raised a key rate and said it was safe to pull back on stimulus spending. It is the first G20 central bank to raise rates.

Ablin said the reaction on Wall Street is a matter of (the rate rise) being an indicator of global growth, and adding to investor enthusiasm.

Caterpillar Inc , the world's largest maker of earth-moving equipment, added 2.3 percent to $51.92 and was the top boost to the Dow industrials.

Freeport-McMoRan Copper & Gold Inc shot up 4 percent to $69.95.

Benchmark U.S. gold futures soared to an all-time high of $1,043.70 an ounce, also on the back of a weak dollar.

Among active issues, Apple Inc rose 1.8 percent at $189.46, leading the Nasdaq index higher.

The PHLX semiconductor index <.SOXX> was up 2.4 percent after research firm Gartner said global semiconductor revenue could increase about 10 percent next year after two years of declines as new computers and smartphones boost chip demand.

Some analysts warned the sharp gains in stocks may be an initial reaction to the overnight rate news.

On the surface, it's great that the global economy is taking shape, but it could raise concerns that the Fed and other central banks may follow the move too soon, said Scott Marcouiller, senior equity market strategist at Wells Fargo Advisors in St. Louis.

(Reporting by Angela Moon; editing by Jeffrey Benkoe)