Oil and gas companies climbed along with the price of oil Friday while industrial companies recovered some of the losses they sustained earlier this month. Beauty products retailer Ulta and software company Adobe rose after strong quarterly reports. Tiffany dropped after reporting weak sales, and online retailers Overstock.com and Wayfair slumped as investors worried about a possible price war.
All this week, stocks moved higher in early trading only to shed those gains as the day went on. They broke out of that pattern Friday, even though the gains were modest.
"From an investor point of view, the fact that we haven't rallied right back to the highs is a good thing," said Randy Frederick, vice president of trading and derivatives at Charles Schwab. Positive news about the economy has been countered by concerns about rising tensions over international trade.
"The pullback that we've been in is pretty much driven by President Trump's proclamation about tariffs," Frederick said.
The S&P 500 index gained 4.68 points, or 0.2 percent, to 2,752.01. The Dow Jones industrial average added 72.85 points, or 0.3 percent, to 24,946.51. The Nasdaq composite rose 0.25 points to 7,481.99. The Russell 2000 index of smaller-company stocks jumped 9.43 points, or 0.6 percent, to 1,586.05.
After a dramatic drop at the beginning of February followed by a rapid recovery of some of their losses, stocks have bounced around for the last month. The Dow, which surged past 26,000 in mid-January, has been wobbling around 25,000 for about a month.
The S&P 500 fell for the first four days of the week and finished with a decline of 1.2 percent. The worst losses came Tuesday and Wednesday after President Donald Trump blocked Singapore-based chipmaker Broadcom's effort to buy its U.S. rival Qualcomm and European leaders warned about the risks of trade disputes.
The Federal Reserve said factory output continued to rise as companies in the U.S. produced more cars, computers and furniture. It reported that manufacturing output rose 1.2 percent in February after three months of weak results. Factory output has increased 2.5 percent over the last year.
The Commerce Department said homebuilders started work on fewer apartment buildings in February, and that caused overall housing starts to drop 7 percent. Builders have shifted their efforts to single-family homes recently as the economy has improved.
Benchmark U.S. crude rose $1.15, or 1.9 percent, to $62.34 a barrel in New York. Brent crude, used to price international oils, climbed $1.09, or 1.7 percent, to $66.21 a barrel in London.
Tiffany dropped $5.20, or 5.1 percent, to $97.51 after it reported weaker sales than analysts expected. Its forecast for the current year was also below what investors were looking for.
Online discount retailer Overstock.com said profit margins have fallen hard because of competition with Wayfair, and CEO Patrick Byrne said the company will "respond in kind," meaning Overstock will try to ramp up its growth and will be willing to lose money to achieve that goal. The stock dropped $2.50, or 5.2 percent, to $45.70 while Wayfair lost $5.01, or 6 percent, to $78.95.
While Broadcom is no longer trying to buy rival chipmaker Qualcomm, both companies are still at the center of deal discussions. The Financial Times reported that former Qualcomm chairman Paul Jacobs wants to take the company private and has had talks with potential investors and the Qualcomm board. Qualcomm added 73 cents, or 1.2 percent, to $60.62, which gives it a market value of about $90 billion.
With the Qualcomm deal finished, Broadcom says it still sees opportunities for other acquisitions. The company also disclosed its quarterly results, and its shares fell $12.89, or 4.8 percent, to $254.87.
The top policymakers at the Federal Reserve will meet Tuesday and Wednesday, and they are expected to raise interest rates again. Since the market is fairly sure of what the Fed will do, there will be a lot of focus on what it says. After the meeting ends, Fed Chairman Jerome Powell will hold his first news conference since he replaced Janet Yellen last month.
Bond prices fell. The yield on the 10-year Treasury note rose to 2.84 percent from 2.83 percent.
In other energy trading, wholesale gasoline gained 2 cents to $1.95 a gallon. Heating oil picked up 2 cents to $1.91 a gallon. Natural gas edged up 1 cent to $2.69 per 1,000 cubic feet.
Gold dipped $5.50 to $1,312.30 an ounce. Silver lost 15 cents to $16.27 an ounce. Copper fell 2 cents to $3.11 a pound.
The dollar declined to 106.10 yen from 106.24 yen. The euro fell to $1.2284 from $1.2303.
The German DAX gained 0.4 percent while Britain's FTSE rose 0.3 percent. The CAC 40 in France added 0.3 percent. Japan's Nikkei 225 fell 0.6 percent while South Korea's Kospi edged 0.1 percent higher and Hong Kong's Hang Seng index dipped 0.1 percent.
AP Markets Writer Marley Jay can be reached at http://twitter.com/MarleyJayAP . His work can be found at https://apnews.com/search/marley%20jay
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.