The Nasdaq led the market's gains on Tuesday after strong profit at Apple Inc and a Chinese distribution deal for BlackBerry maker Research in Motion showed tech stocks may still have room to grow.

The Nasdaq's gain topped 1 percent after RIM said it is teaming up with Alcatel-Lucent to distribute the BlackBerry in China.

Tech shares were already in the lead after Apple reported profit and sales late on Monday that handily beat Wall Street estimates.

Both Apple and RIM shares reached record highs.

Tuesday's rally is not very broad-based, but the strength of leadership out of (the) tech sector is tremendous, said Peter Kenny, Capital has been rotating out of value and into growth and into global growth for the better part of six months. That story is what's pushing the leader further ahead of the pack.

The Dow Jones industrial average was up 75.36 points, or 0.56 percent, at 13,642.33. The Standard & Poor's 500 Index was up 8.24 points, or 0.55 percent, at 1,514.57. The Nasdaq Composite Index was up 34.38 points, or 1.25 percent, at 2,788.31.

Apple rose more than 7 percent to a record $186.60. RIM stock surged more than 11 percent to $125.96

Shares of online marketplace, which was set to report after the session close, were up 7.1 percent to $98.50.

Shares of Google, which has recently traded in near lock-step with Apple, jumped more than 4 percent to a record high of $677.60.

The feeding frenzy in tech overshadowed a wave of disappointing news from retailers.

Wal-Mart, the world's largest retailer, outlined a store-opening plan that signaled a slower increase in square footage and capital spending, which sent shares down.

Wal-Mart shares fell 3 percent to $43.89. Wal-Mart rival Target cut its October sales forecast at stores open at least a year late on Monday, sending its shares down 0.7 percent to $61.14 on the NYSE.

Third-quarter profits have been a source of concern, with earnings growth forecast at just 1.8 percent -- the slowest in about five years -- according to Reuters Estimates.

Semiconductors were also a drag after chip maker Texas Instruments Inc. gave a revenue outlook that was below analysts' estimates late on Monday.

Texas Instruments shares were down $3.20 to $31.07. The stock tumbled more than 10 percent, logging its biggest decline in more than five years. Shares of Intel, the world's biggest chip maker, were down 1.3 percent to $26.29, adding to the drop in the benchmark Philadelphia Stock Exchange semiconductor index, which hit a two-month low.