U.S. stocks closed sharply higher Friday as Wall Street shrugged off lackluster numbers in the government's monthly jobs report while shares of Apple hit an all-time high to lead the technology sector higher.

The Dow Jones industrial average closed 332.36 points higher at 24,262.51 thanks to a 3.9 percent rally in Apple's stock, which jumped after famed investor Warren Buffett revealed that he bought millions of shares of the iPhone maker in recent months. By the closing bell, Apple had posted a gain of 13.45 percent for the week, its best since October 2011.

The rose 1.2 percent to finish at 2,663.42 after falling 0.4 percent earlier in the day, buoyed by a nearly 2 percent gain in tech, which led all 11 sectors for gains. The Nasdaq composite rose 1.7 percent to close at 7,209.62, its first positive day in the last three sessions. The index was led higher by the aforementioned rally in Apple, a 1.4 percent gain in Facebook and a 2.4 percent boost in Google-parent Alphabet.

The positive numbers on Friday, however, were not enough to offset weekly losses for the Dow and S&P 500, each down roughly 0.2 percent since Monday.

Leading the strong numbers in stocks Friday, Apple jumped sharply after billionaire investor Warren Buffett revealed that he bought 75 million shares during the first quarter, which added to the conglomerate's already massive stake in the tech giant.

Buffett estimated that Berkshire Hathaway's cash position dipped to "a little over" $100 billion because of lots of stock buying in the first three months of the year.

In its earnings report this week, iPhone sales were still up from a year ago, and Apple CEO Tim Cook said in a statement that customers "chose iPhone X more than any other iPhone each week in the March quarter."

"Tech is having a good day and obviously Apple is helping. The Warren Buffett headlines have helped give momentum to share prices," said Quincy Krosby, chief market strategist at Prudential Financial.

Tech also rose after a 4.5 percent bump in Activision Blizzard, which reported adjusted earnings and revenue that beat Wall Street expectations Thursday. The company reported its official numbers after Dow Jones reported a few incorrect headlines about its financial report earlier on Thursday.

The Labor Department reported that the economy added 164,000 jobs in the month of April, lower than the 195,000 expected by economists polled by Reuters. Average hourly earnings growth also missed, rising only 0.15 percent against expectations of a 0.2 percent gain.

"I also think the unemployment report was helpful for the bears and was also helpful for the bulls: It underscores the tug-of-war in the market," Krosby added. "You had a pullback in the wages, but then again, if you look below the headline number, it shows strength. It helps assuage fears that inflation in galloping higher."

Overall, Krosby said, market volatility has fallen back into a more comfortable range and valuations have become a little more attractive, though perhaps not enough to drive a significant uptick in trading volume.

Still, markets have been keeping an eye on interest rates and signs of burgeoning inflation.

Despite the miss in the number of jobs added, the government said the unemployment rate fell to 3.9 percent, an 18-year low.

"I was surprised we had a bit of a sell-off there," said JJ Kinahan, chief market strategist at TD Ameritrade. "You're a little bit light on the top line, and a little bit disappointing on the wage growth, but there was very little job loss and a revision higher from what was considered a very disappointing read last month."

Changes in the average hourly earnings numbers are closely watched by members of the Federal Reserve as a bellwether for inflation. Hourly earnings have been increasing at about a 2.7 percent pace, which is above the recovery pace but still short of where Federal Reserve officials are targeting.

Still, the average hourly earnings miss wasn't large enough to derail fears of more aggressive tightening from the Fed, TD Ameritrade's Kinahan added.

Those who fear rising rates "can find something in here to say it's good enough to keep down the path to four hikes this year," he said. "The other thing is, after we had that big down move yesterday and then came back, there's a bit of a natural pressure early in the day."