WASHINGTON — Unemployment rates rose in 44 U.S. states in July, the most states to show a monthly increase in more than three years and a reflection of weak hiring nationwide.

The Labor Department says unemployment rates fell in only two states and were unchanged in four.

Unemployment rates rose in nine states that are considered battlegrounds in the presidential election. That trend, if it continued, could pose a threat to President Barack Obama’s re-election bid in less than three months.

Nationwide, hiring improved in July after three months of tepid hiring. But the national unemployment rate ticked up to 8.3 percent from 8.2 percent. Monthly job gains have averaged 150,000 this year. That’s barely enough to accommodate population growth. As a result, the unemployment rate is the same as when the year began.

Still, 31 states gained jobs in July, while 19 lost them. Unemployment rates can rise in a state even when more jobs are created if more people start looking for jobs. People who are out of work are counted as unemployed only if they’re looking for a job.

In the most closely contested states in the presidential race, unemployment has fallen over the past year. But it has started to tick up in recent months. In Nevada, the rate rose to 12 percent in July from 11.6 percent. That’s the highest rate in the nation, though it’s still much lower than a year ago, when it was 13.8 percent.

In Florida, the rate increased to 8.8 percent from 8.6 percent in June. Unemployment also increased in Virginia, North Carolina, Iowa, Pennsylvania, Michigan, Colorado, Wisconsin and New Hampshire.

The rate was unchanged at 7.2 percent in Ohio, the only swing state that didn’t suffer an increase. Still, that rate is down sharply from 8.9 percent a year ago.

Some battleground states reported large job gains that could lead to lower unemployment rates in coming months. Michigan added 21,800 jobs, the second-largest increase in the nation, after California. Michigan’s gains were mostly in manufacturing and government. Virginia reported the third-largest increase, 21,3000, mainly in education and health care.

Most other battleground states added small numbers of jobs.

Unemployment rates and total jobs data are derived from two separate surveys and aren’t always consistent each month. But they tend to even out over time.

The economy hasn’t been growing fast enough to generate more hiring. It expanded at an annual rate of only 1.5 percent in the April-June quarter, down from 2 percent in the first quarter and 4.1 percent in the final three months of last year.