WASHINGTON – Unemployment fell in fewer states in July than in the previous three months, a sign that the pace of job growth has slowed.

The jobless rate dropped in 18 states and Washington, D.C. last month, the Labor Department said Friday. It rose in 14 states and stayed the same in 18. That’s a slowdown from the past three months when unemployment fell in more than 30 states.

Nationwide, the unemployment rate remained stuck at 9.5 percent in July.

The report suggests many states are seeing less improvement in the job market than earlier this year. But there were positive signs that indicate the recovery hasn’t stalled out.

Thirty-seven states saw job gains in July, an improvement from June but below the 41 states that gained jobs in May. That occurred even as many states lost temporary census jobs. Overall, 143,000 census jobs across the country ended in July. Private employers, meanwhile, added 71,000 jobs last month.

Job market improvement “is slow, but it’s still moving in the right direction,” said Steve Cochrane, an economist at Moody’s Analytics.

There was good news in the Northeast. Massachusetts had strong job gains, adding 19,200 private-sector jobs, the largest monthly gain in more than 20 years.

The increases in Massachusetts were broad-based. They included 6,100 new jobs in hotels and restaurants, 1,600 additional jobs in retail and 2,800 new jobs in manufacturing.

The state was one of the first to see its housing sector slump, Cochrane said, and may now be exiting the downturn earlier than other states. Still, Massachusetts’ unemployment rate was 9 percent in July, the same as in June.

New York added 29,000 private-sector jobs, the largest gain since April 2005. The state reported more jobs in leisure and hospitality, manufacturing, construction and professional and business services.

Several Midwest states reported large job increases in manufacturing. Increasing industrial output has powered the recovery in the past year. Automakers in particular have boosted production after many car dealers cleared their lots during last year’s Cash for Clunkers program.

Michigan reported a jump of 27,800 new jobs in July, most of them in manufacturing.