Employers shook off two months of weak hiring and added 287,000 jobs in June, a blistering pace that points to a resilient U.S. economy recovering from a weak winter and spring.

The hiring spurt marked a sharp improvement from May's dismal showing, when just 11,000 jobs were added. A modest 144,000 jobs were created in April. May's figure was revised lower, while April's is higher than initially reported.

The unemployment rate rose to 4.9 percent from 4.7 percent as more Americans began looking for jobs, a sign they were more confident about their prospects.

The broadly positive report suggests the U.S. economy was improving before the United Kingdom startled the world late last month by voting to leave the European Union.