Apple $1 Trillion (copy)

Apple shareholders had their best week in the stock market since August. File

Wall Street finished the week with solid gains Friday as technology stocks notched their best week in four months.

Financial, health care and consumer stocks joined in the market rally. The gains erased losses from last week, when the S&P 500 had its worst week of the year. The benchmark index has now posted a weekly gain nine out of 11 times this year.

Technology stocks had their best week since November. Apple ended the week with a 7.6 percent gain, its best week since August. Industrial stocks were the biggest laggard Friday.

Investors bought bonds after a report on industrial production showed a second consecutive monthly decline in manufacturing in the U.S. That sent the yield on the 10-year Treasury lower. It fell to 2.59 percent from 2.63 late Thursday.

Despite the gains, global political turmoil over trade and more still weighs on investors, said Katie Nixon, chief investment officer at Northern Trust Wealth Management.

"There's so much importance placed on these geopolitical risks," Nixon said. "They have to be resolved for the market to go forward."

U.S. stocks have made a strong showing this year, with all major indexes posting gains of at least 10 percent.

Investors seemed encouraged by reports that the U.S. and China could be making progress on critical negotiations aimed at resolving a trade war between the world's two biggest economies. China's congress endorsed an investment law that aims to address complaints from the U.S. and others that its system is rigged against foreign companies. The U.S. claims China forces companies to share technology in order to do business in the country.

Traders are also confident that the Federal Reserve will hold off on any action that could jeopardize economic growth. The central bank, which signaled in January that it was hitting pause on its rate hikes amid a slowdown in global growth and the absence of inflation pressures, is holding a meeting of policymakers next week.

Economists expect the Fed will keep rates on hold. Friday's surge in bond purchases also indicates that investors don't foresee the Fed raising interest rates any time soon.

"There's no chance of a rate hike," said Willie Delwiche, investment strategist at Baird.

Chipmakers made up six of the top 10 gainers in the S&P 500 Friday.

Broadcom led the technology sector rally after the chip provider reported a better-than-expected rise in fourth-quarter profit and told investors that it would return $12 billion to stockholders in 2019 through dividends and buybacks. The stock jumped 8.2 percent.

CEO Hock E. Tan expects the chip business to hit a low in the second quarter and then notch growth during the second half of the year. That assessment helped give other chipmakers a lift.

Health care, financial and consumer stocks also notched solid gains. Biogen added 2.6 percent, Morgan Stanley rose 1.5 percent, and Amazon gained 1.6 percent.

Investors also bid up shares in Ulta Beauty after the cosmetics retailer's latest quarterly results topped Wall Street's forecasts. Its stock jumped 8.3 percent.

Facebook dropped 2.5 percent on news that two of the social media company's longtime executives are resigning following the company's recent announcement that it will shift its emphasis to private messaging from public sharing.

Shares in Tesla skidded 5 percent after the electric car maker unveiled its Model Y, a mid-size SUV that starts at $39,000. The unveiling comes as Tesla tries to expand into the mainstream and cash in on the red-hot market for SUVs.

Boeing shares recovered from an early slide to gain 1.5 percent after a report suggested the aircraft manufacturer will roll out a software fix for its 737 Max airplanes later this month.

The stock has been hammered this week after a 737 Max flown by Ethiopian Airlines crashed Sunday in Ethiopia, killing all 157 people on board. A similar Boeing flown by Lion Air crashed in Indonesia in October, killing 189 people. The U.S. and other countries have since grounded the Boeing 737 Max 8.

Shares in Boeing, which is one of the larges employers in the Charleston region, fell 10.3 percent this week. The stock is still up almost 15 percent for the year.