U.S. stocks advanced to the highest levels this year amid optimism on the economy and expectations for only gradual increases in interest rates, overshadowing a selloff in oil.

Signs of strengthening growth in jobs and manufacturing data, coming right after Federal Reserve Chair Janet Yellen this week indicated global risks warranted restraint on lifting rates, presented the best of both worlds for investors Friday to help to overcome an early retreat sparked by falling crude prices.

The Standard & Poorโ€™s 500 index rose 0.6 percent to 2,072.78 at 4 p.m. in New York, the highest close in 2016 while pushing this yearโ€™s gain to 1.4 percent. The Dow Jones Industrial Average added 107.66 points, or 0.6 percent, to 17,792.75, the highest since Dec. 4 after reversing a 117-point slide. The Nasdaq Composite Index increased 0.9 percent to its highest this year. About 7 billion shares traded hands on U.S. exchanges, 17 percent below the 2016 average.

โ€œWe now have a super dovish Fed in our corner and jobs data in line with the trend,โ€ said Yousef Abbasi, global market strategist at JonesTrading Institutional Services LLC in New York. โ€œThe market initially sold off on the conflict of a dovish message and then beats on every single line of the data, but now people are realizing you have a combination of better economic data and a Fed thatโ€™s being very gentle with the market. It seems the Fedโ€™s more concerned with the global picture than the domestic picture.โ€

Equities shook off early losses after data showed manufacturing activity expanded in March for the first time in seven months, in a sign factories are emerging from their worst slump since the last recession. That followed a report showing payrolls and average hourly earnings rose more than forecast, while the jobless rate crept up as more people entered the labor force.

Additional tightening in the job market that sparks bigger pay gains for American workers may convince Fed policy makers that the economy is more insulated to weakness overseas.

The S&P 500 rose after its strongest monthly climb since October. Equities staged a sizzling comeback in the first quarterโ€™s final six weeks, as crude rebounded from a 12-year low and central bankers from Asia to Europe and America eased concerns that a global slowdown would deepen as they signaled a willingness to bolster growth. The gauge rose 0.8 percent in the past three months, marking the first time since 1933 it finished a quarter with a gain after falling at least 10 percent.

Still, the late-quarter rally came amid light trading, with a three-week stretch thatโ€™s seen the S&P 500 go its longest without a daily move of 1 percent in more than a year. The index is now 2.7 percent from a record reached last May. The Chicago Board Options Exchange Volatility index fell 32 percent in March, snapping its longest streak of monthly increases in four years. The measure of market turbulence known as the VIX slipped 6.1 percent Friday to 13.10, its lowest since Aug. 17.

โ€œThereโ€™s good data across the board and itโ€™s consistent with the view that manufacturing sector has bottomed,โ€ said Jon Adams, portfolio manager at BMO Asset Management Corp. in Chicago, where he helps oversee $217 billion. โ€œThe weaker dollar over the last couple of months will help as well, as will stabilization in energy prices.โ€

Policy makers have stressed the timing of rate increases will depend on progress in economic data, though the Fedโ€™s Yellen boosted stocks this week after saying heightened risks to the global economy warranted a cautious approach to further rate hikes.

Traders are pricing in no chance the central bank will raise rates in April, while the probability of a June move rose to 24 percent after the jobs report from 20 percent. Odds for June were 38 percent a week ago, before Yellenโ€™s remarks. November is now the first month with at least even odds of higher borrowing costs, replacing December after todayโ€™s data.

As the second quarter begins, attention will shift to the earnings season, which unofficially kicks off when Alcoa reports first-quarter results on April 11. Analysts estimate profit at S&P 500 firms fell 9.5 percent during the period, compared with forecasts for a 4.5 percent drop two months ago.

In Fridayโ€™s trading, roles were reversed among the S&P 500โ€™s 10 main industries, with investors selling last monthโ€™s biggest winners โ€” energy producers โ€” and scooping up health-care shares which lagged the most in March.

A rally among drug developers propelled health-care higher, after the Nasdaq Biotechnology Indexโ€™s worst quarterly drop in nearly 14 years. The gauge rose 2.9 percent Friday, the biggest climb in a month.

Regeneron Pharmaceuticals jumped 12 percent, the most in four years. Its drug to treat a serious skin condition met its goals in two final-stage trials. Amgen added 2.8 percent to a two-month high, while Pfizer rose 1.4 percent.

Banks in the benchmark resumed a climb after their best month in more than a year. Citigroup and JPMorgan Chase increased at least 1.1 percent. In the broader financial group, Capital One Financial and Morgan Stanley added more than 2 percent. Goldman Sachs Group gained 1.8 percent, rising for a fifth session in its longest rally since November.