U.S. employers posted the most job openings in four years in June, a positive sign that hiring may pick up.

The Labor Department said Tuesday job openings rose to a seasonally adjusted 3.8 million in June, up from 3.7 million in May. That’s the most since July 2008. Layoffs fell.

The data follow Friday’s report that said employers in July added the most jobs in five months. A rise in openings could signal better hiring in the coming months. It typically takes one to three months to fill a job.

Even with the increase, hiring is competitive. There were 12.7 million unemployed people in June, or an average of 3.4 unemployed people for each job.

That’s down a bit from May and much lower than the nearly 7-to-1 ratio in July 2009, just after the recession ended. In a healthy job market, the ratio is usually around 2 to 1.

Still, employers have been slow to fill jobs. Since the recession ended in 2009, openings have increased 57 percent. Overall hiring is up only 19 percent.

And openings are still below pre-recession levels of nearly 4 million per month.

Employers added 163,000 jobs in July, the department said last week. That followed three months of weak hiring and eased concerns that the economy was stalling.

Yet the economy has generated an average of 150,000 jobs per month this year, about the same pace as 2011. That’s not enough to rapidly drive down the unemployment rate.

The unemployment rate ticked up to 8.3 percent in July from 8.2 percent in June.

In June, manufacturing, education and health care, and hotels and restaurants all posted more openings. Retailers and state, local and federal government agencies cut available jobs.

The government’s monthly employment report, released last Friday, measures net hiring.

Tuesday’s report, known as the Job Openings and Labor Turnover survey, shows the amount of hiring and firing that takes place in the U.S. each month. It provides more details than the monthly jobs report.

For example, layoffs dropped to 1.8 million in June, from nearly 2 million in May. June’s total is below pre-recession levels and indicates that companies aren’t cutting more jobs, despite sluggish growth.

And the number of people that quit their jobs also ticked down slightly to 2.1 million, from 2.2 million in May. That’s still higher than a year ago, when only 1.9 million people quit.

When more people quit their jobs, it can be a sign of a strengthening job market. That’s because most people quit when they have a new job, usually with better pay. The number of quits is still far below the pre-recession level of about 2.7 million.

Overall, companies hired nearly 4.4 million people in June, down from 4.5 million in May, the JOLTS report showed. At the same time, nearly 4.3 million people were laid off, quit or left jobs for other reasons, such as retirement.

The difference between those two figures is similar to the net job gain that the Labor Department includes in the employment report each month.