The Nasdaq composite index rose 88.87 to 3,966.10, and the Standard & Poor's 500 index climbed 12.21 to 1,454.60. The Dow Jones industrial average rose 49.85 to close at 10,447.89, led by Procter & Gamble and United Technologies. P&G closed up $3.63 at $57.25, while United Technologies rose $3.50 to $58.
For the quarter, the Nasdaq fell 13 percent, and the Dow dipped 4 percent.
"There was a huge surge in trading volume at the end of the day caused by the re-balancing of the 21 Russell indexes and the re-positioning of institutional funds," said market analyst Larry Wachtel of Prudential Securities.
Every year at the end of June, the Frank Russell Company revamps its indexes. The institutional funds that mirror the stocks in the Russell then follow suit.
The end of the quarter is also the time when fund managers do a final frenzy of buying and selling to "window dress" their portfolios so they end up showing as much gain as possible (or as few losses).
Looking ahead, Wachtel said "earnings season will be good, but not great." Last quarter's earnings were spectacular, but I don't think upcoming earnings will be as good."
Wachtel added that solid earnings will probably not spark the markets to higher levels. "I don't think earnings season will be enough of a catalyst to turn the markets into a roaring bull," he said. "The mania of the first quarter will be gone."
Among the larger tech stocks, Intel closed up $1.94 at $133.69, and Microsoft rose $2.81 to $80.
The CNET tech index gained 48.14 to close at 2,803.34. Advancers trounced decliners by a 2-to-1 margin, with 61 of the 97 stocks in the index rising, 34 falling and two remaining unchanged.
Of the 18 sectors tracked, server software makers posted the biggest gains, climbing about 4 percent. Technology distributors fell furthest, dipping 1 percent.
The initial public offering of StorageNetworks, a network storage company, was the biggest percentage gainer on the Nasdaq. The shares jumped $63.25, or 234 percent, to $90.25. Volume topped 13.3 million shares.
Among members of the CNET tech index, Broadcom and Xerox posted strong gains.
Xerox rose $2.19, or about 11 percent, to $20.75, while Broadcom jumped $14.19 to $218.94, boosting its gain for the week to 33 percent.
The Philadelphia semiconductor index rose 16.01 to 1,144.20, led by chipmaker Linear Technology, which rose $5.13 to close at $63.94.
Meanwhile, shares of Genuity received a cool reception this week. After the company raised nearly $2 billion in its IPO, the shares closed today at $9.16, well below the $11 offering price.