(AP) -- Wall Street added to its recent gains Friday with a broad rally that broke the market's three-week losing streak.
The S&P 500 closed 1.5% higher, its third straight increase, and ended with a 3.7% gain for the week. That makes it the benchmark index's best week going back to July.
Big gains for technology companies pushed the Nasdaq composite to a 2.1% gain, while the Dow Jones Industrial Average rose 1.2%. Both indexes also notched their first weekly gain in four weeks.
The latest gains punctuated a holiday-shortened week of trading on Wall Street during which the market regained some of the ground it lost after a mid-August slump that wiped away the much of the gains from a mid-summer rally.
A weaker dollar and a reversal among short-sellers --- traders who bet that the market will go lower ---- appeared to be responsible for some of the rally Friday, said Sameer Samana, senior global market strategist at Wells Fargo Investment Institute.
"You had a little bit of a positive catalyst in the dollar coming off today, and lo and behold that extreme positioning had to kind of be unwound," he said. "We probably wouldn't read too much into it. For us, anyway, the trend in (stocks) remains lower."
The S&P 500 rose 61.18 points to 4,067.36. The index is still down about 15% so far this year.
The Dow added 377.19 points to 32,151.71, while the Nasdaq rose 250.18 points to 12,112.31.
Technology stocks and retailers had some of the biggest gains. Microsoft rose 2.3% and Amazon rose 2.7%.
DocuSign jumped 10.5% after the electronic signature company reported strong second-quarter sales and raised its subscription forecast.
All 11 industry sectors in the benchmark S&P 500 rose, though makers of household goods and utilities, which are typically considered less risky investments, lagged the market. U.S. crude oil prices rose 3.9%, helping push up energy sector stocks. Exxon Mobil rose 1.7%.
Smaller company stocks also notched solid gains. The Russell 2000 index rosed 35.94 points, or 1.9%, to 1,882.85.
Bond yields mostly rose. The yield on the 10-year Treasury, which influences interest rates on mortgages and other loans, slipped to 3.31 from 3.33% late Thursday. The two-year Treasury yield, which tends to track expectations for actions by the Federal Reserve, rose to 3.57% from 3.51%.
The Fed has been the main focus for investors as they try to figure out whether the central bank's plan to cool the hottest inflation in four decades will work or possibly trip an already slowing economy into a recession.
Stocks spent July and part of August gaining ground on hopes that the Fed would ease up on its interest rate hikes, but slumped over the last few weeks as it became clear the central bank remained resolute in raising rates.
The central bank has already raised rates four times this year and markets expect it to deliver another jumbo-sized increase of three-quarters of a percentage point at its next meeting in two weeks. Fed officials, including Chair Jerome Powell, have all reaffirmed the central bank's determination in raising rates until inflation is under control.
That has left investors closely watching economic data for any sign that inflation might be cooling. The calendar for such updates will be busy next week.
The Labor Department will release its report on consumer prices for August on Tuesday and a report on wholesale prices on Wednesday. On Thursday, Wall Street will get an update on retail sales for August.