Employers shook off two months of weak hiring by adding 287,000 jobs in June, a robust pace that suggests a resilient U.S. economy recovering from a slump early in the year.

The strong report shows that the U.S. job market was improving before the United Kingdom voted late last month to leave the European Union, raising fears of a global recession. Friday's Labor Department figures suggest that the U.S. economy, which has defied overseas weakness before, might be able to do so again.

The June hiring spurt marked a sharp improvement from May's dismal showing, when only 11,000 jobs were added, and April's modest gain of 144,000. June's increase was the largest since October 2015.

The unemployment rate rose from 4.7 percent to a still-low 4.9 percent, the government said in its monthly jobs report. But the uptick occurred mainly for an encouraging reason: More Americans began seeking jobs — a sign of growing confidence in their prospects — though most didn't immediately find work.

Investors were pleased with Friday's report. The Dow Jones industrial average was up more than 200 points, about 1.1 percent, in early-afternoon trading.

"This is clearly positive news after the worrying slowdown in previous months," Andrew Hunter, assistant economist at Capital Economics, wrote in a research note.

Strong hiring, if sustained, could complicate Donald Trump's efforts to portray the U.S. economy as faltering. The presumptive Republican presidential nominee had referred to May's weak jobs report as a "bombshell" but hasn't commented on Friday's report.

Hillary Clinton, the likely Democratic nominee, hasn't campaigned on the economy's strength, focusing instead on the stagnation of middle class incomes. This week, she proposed measures to reduce college costs.

The campaign will heat up in coming weeks as the Republican convention starts in 10 days, with the Democrats' convention beginning a week later.

Average hourly pay, a chronic weak spot in the seven-year U.S. recovery from the Great Recession, ticked up in June. Over the past 12 months, average wages are up 2.6 percent — the best year-over-year gain since December, though still below the historical trend for healthy economies of about 3.5 percent.

Friday's report provided other evidence of an improving job market. The number of part-time workers who would prefer full-time jobs fell sharply, reversing an increase in May.

And hiring was widespread across both higher and lower-paying sectors. Manufacturers added 14,000 jobs, the most since January. Professional and business services, a category that includes accountants, engineers and architects as well as temporary workers, gained 38,000. Retailers added nearly 30,000 workers, health care over 58,000.

Even with June's big gain, job growth so far for 2016 trails last year's pace. Employers added an average of 172,000 jobs a month in the first six months of this year. That's generally enough to lower the unemployment rate, but it's below last year's monthly average of 230,000.

The recent hiring slump had come after the economy grew at a tepid 1.1 percent annual rate in the first three months of the year. Americans' spending rose at the slowest pace in two years during that time — a significant drag given that consumer spending drives around 70 percent of the economy.

Concerns about the global economy have deepened since the U.K.'s "Brexit" vote to leave the EU. The yield on the 10-year U.S. Treasury note this week touched a record low of 1.34 percent, though it rose to a still very low 1.4 percent after Friday's jobs numbers.

Such a decline has historically signaled anemic growth and even an outright recession. When investors fear for the future and seek safe returns for their money, they typically shift into Treasurys. That flow of money forces down yields.

The hiring slowdown caught Federal Reserve officials off guard. During their June meeting, they cited the weak jobs figures as a key reason for putting off any further rate increases. That sentiment signaled a shift from their April meeting, when many the policymakers had indicated that they were prepared to raise rates if the job market and the economy continued to improve.

"Today's report helps the case for more Fed tightening before too long — if strength is sustained — although officials are being ultra-cautious amidst turmoil in global markets," Jim O'Sullivan, chief U.S. economist at High Frequency Economics, wrote in a research report.

Recent U.S. economic data had pointed to an improvement from the sluggish start to the year, though all of it pre-dated the Brexit vote. Americans, for example, ramped up their spending in April and May, and measures of consumer confidence also grew. The stronger spending led economists to forecast that annualized growth rebounded to 2 percent or more in the April-June quarter.

Manufacturing companies expanded in June at their fastest pace since November, according to a survey by the Institute for Supply Management, a trade group. Services companies, including retailers and banks, also grew at a faster pace in June, the ISM found.

And home sales have marched upward this year despite a low supply of houses for sale. Sales of existing homes reached a nine-year high in May.

Associated Press