U.S. stocks booked a fourth straight daily gain Friday, and the Dow and S&P 500 marked their best week this year as stocks clawed back some of the losses scored in the wake of the tumult that followed the U.K.’s decision last week to sever ties with the European Union.

Better-than-expected manufacturing data combined with fading worries about the Brexit, or British exit from the EU, stoked appetite for equities.

Read:Which markets are closed for July Fourth?

Although marked by choppy trade, the Dow Jones Industrial Average DJIA, -0.87% rose 19.38 points, or 0.1%, to finish at 17,949.37. Home Depot Inc. shares, up 1.5%, led blue-chip advancers. The Dow came within a whisker of its pre-Brexit close of 18,011 before retreating in the afternoon.

Meanwhile, the S&P 500 index SPX, -1.11% recaptured the psychologically significant 2,100 level to close up 4.09 points, or 0.2%, at 2,102.95. A 0.9% rise in consumer-discretionary shares, led by a nearly 20% surge by Harley-Davidson Inc. HOG, -2.05% on buyout rumors, underpinned positive momentum for the broad-market benchmark.

See:These stock markets left the rest of the world in their wake in the first half of 2016

Both the S&P 500 and the Dow posted their best weekly gains, up 3.2%, since the week ended Nov. 20, according to FactSet data.

Meanwhile, the Nasdaq Composite Index COMP, -1.07% rose 19.89 points, or 0.4%, to close at 4,862.57. The Nasdaq gained 3.3% on the week for its best climb since the week ended May 27.

Trading volume was lighter-than-usual ahead of the July Fourth holiday on Monday when U.S. markets will be closed. Light volume can lead to choppy trading.

Over the past three trading sessions, the Dow has risen by nearly 800 points, while the S&P leapt about 5% over the last several sessions, as markets rebounded sharply from Brexit concerns. That vote roiled markets last Friday and Monday.

“Markets are coming to the determination that [Brexit] matters but it is not the catastrophic event people had feared,” said Jonathan Golub, chief U.S. equity strategist at RBC Capital Markets.

On Friday, markets also were boosted by data that showed U.S. manufacturing activity grew in June at the fastest pace in 15 months. The Institute for Supply Management said its manufacturing index jumped to 53.2% in June from 51.3% in May, marking an uptrend after a bout of extended weakness.

Robert Pavlik, chief market strategist at Boston Private Wealth, attributed Friday’s climb to the manufacturing reading, investors rebalancing their portfolios to start the second half of 2016, and other traders playing catch-up in equities following a multiday climb for stocks.

Fed speakers: Federal Reserve Vice Chairman Stanley Fischer on CNBC said that he saw the U.S. economy improving.

In London, Cleveland Fed President Loretta Mester said the central bank risks destabilizing markets by waiting too long to hike benchmark interest rates in 2016. She also said she didn’t vote for a rate increase at the Fed’s most recent meeting because of Brexit worries.

Economic docket: On the data front, spending on construction tumbled in May, with weakness mostly concentrated in the public sector, the Commerce Department said Friday. However, comparatively, construction spending was still better than the same period a year ago.

Auto makers are on track for their best June U.S. auto sales in more than a decade, according to The Wall Street Journal, as summer sales started to heat up during the month.

Ford Motor Co. F, -0.68% said that vehicle sales rose 6.4% in June. General Motors Co. GM, -1.31% reported overall sales slipped 1.6% as the auto maker continues with a planned cut back of less profitable fleet sales. Retail sales, though, rose 1%, on strength in the Chevrolet, Buick and Cadillac brands, WSJ said.

Corporates:Tesla Motors Inc. shares TSLA, +4.42% rose 2% even after the electric-car maker confirmed late Thursday that the National Highway Traffic Safety Administration is investigating Tesla’s autopilot feature. That probe comes after a Model S using the autonomous-driving feature was involved in a deadly crash in Florida.

Stock in Chipotle Mexican Grill Inc. CMG, -0.80% fell 2.2% after the restaurant chain put Mark Crumpacker, chief creative and development officer, on administrative leave following his indictment in Manhattan over his alleged involvement in a cocaine drug ring.

Apple Inc. AAPL, -3.17% is in exploratory talks to buy Tidal, the music-streaming service founded by rap mogul Jay Z, according to The Wall Street Journal. Apple’s shares finished up 0.3%.

Hewlett-Packard Inc. HPQ, -0.99% late Thursday won a $3 billion judgment in a court battle against Oracle Corp. ORCL, -0.71% . Oracle plans to appeal.

Micron Technology Inc. shares MU, -0.47% dropped 9.2% after the memory-chip maker Thursday evening swung to a quarterly loss and said it would cut jobs as part of a cost-cutting plan.

Williams Cos. shares WMB, -2.67% fell 5% after nearly half of the energy company’s board resigned following a failure to oust Chief Executive Alan Armstrong, The Wall Street Journal reported. The leadership battle came after the company’s collapsed merger with Energy Transfer Equity LP US:ETE, the report said.

Other markets:Asian stocks NIK, +0.17% SHCOMP, -0.63% closed higher Friday, bolstered after the speech by the BOE’s Mark Carney.