Stocks rose in volatile trading on Friday, but still posted sharp losses for the week as investors fretted over rising interest rates, high technology valuations and worries about a possible economic slowdown.

The Dow Jones Industrial Average gained 287.16 points to 25,339.99, led by a 4.7 percent surge in Visa. The jumped 1.4 percent to 2,767.13, snapping a six-day losing streak, as the tech sector surged 3.2 percent. The Nasdaq Composite outperformed, surging more than 2 percent to 7,496.89.

Stocks traded in a wide range Friday. The Dow gained as much as 414 points and briefly turned negative. The S&P 500 and Nasdaq also gave back big chunks of their gains before rallying into the close.

Despite the strong gains on Friday, the Dow and S&P 500 finished the week down by more than 4 percent, while the Nasdaq posted a 3.7 percent weekly loss. The steep losses marked their worst weekly declines since March. The S&P 500 also logged in a three-week losing streak, its longest since June 2016.

Wasif Latif, head of global multi-assets at USAA, said investors should remain cautious in the near term. "It's too early to tell if we're out of the woods yet," he said. "We have to wait and see how the market reacts in the next few days."

Sentiment was rocked around the globe, as investors grew nervous over the rise in interest rates and high valuations in tech shares.