Rising prices have erased U.S. workers’ meager wage gains, the latest sign strong economic growth has not translated into greater prosperity for the middle and working classes.

Cost of living was up 2.9 percent from July 2017 to July 2018, the Labor Department reported Friday, an inflation rate that outstripped a 2.7 percent increase in wages over the same period. The average U.S. “real wage,” a federal measure of pay that takes inflation into account, fell to $10.76 an hour last month, 2 cents down from where it was a year ago.

The lack of wage growth has befuddled economists and policymakers, who hoped that after job openings hit record highs and the unemployment rate dipped to the lowest level in decades, employers would give beefy raises to attract and retain workers. But so far, gains have been slight, and small recent increases are being eclipsed by rising prices.

Inflation hit a six-year high this summer, in part because of a jump in energy costs. The price of a gallon of gas has increased 50 cents in the past year, up to a national average of $2.87, according to AAA. Some analysts expect the climb in energy prices to halt soon, which should bring the overall inflation rate down and possibly lift real wages slightly.

Consumers are also paying more for housing, health care and automobile insurance, the federal government reported Friday. Additional price increases could be coming as President Trump’s new tariffs boost the prices of cheap imported products on which U.S. consumers rely. And many economists warn that growth might have peaked for this expansion.

The combination of rising prices and stagnant wages poses a problem for Trump, who campaigned on promises of jobs and raises for the working-class Americans he called “the forgotten men and women of our country.” Delivering prosperity for those workers has proved difficult for Trump, as it was for Presidents Barack Obama and George W. Bush.

Trump’s top economic advisers warn against focusing too much on one measure of wage growth. Other metrics have shown stronger pay gains. The Atlanta Federal Reserve’s wage tracker, which does not take inflation into account, is showing 3.2 percent wage growth over the past year, and White House officials promise that further gains are coming soon.

“We’re close to full employment,” said Kevin Hassett, the chair of Trump’s Council of Economic Advisers, who added that businesses are making new investments in the United States, which should increase workers’ productivity and pay in the coming years.

“All of the preconditions are there for wage growth north of 4 percent,” he said.

Hassett said many lower-skilled workers have reentered the labor force in recent months, an encouraging sign, but also a trend that might be holding down average pay since many of these workers cannot immediately command high pay.

Thus far, however, most benefits of the strong economy appear to have gone to high-paid workers, stock market investors and corporations. The stock market hit record highs this year. Corporations, benefiting from a historic Republican cut to the corporate tax rate passed in December, have seen profits soar. Second-quarter earnings are up more than 20 percent over last year among companies that have reported so far, according to FactSet, a financial data tracker.

Within the workforce, gains have been uneven, even as unemployment fell from a peak of 10 percent in October 2009 to the current 3.9 percent in July.

Workers in the top 10th of the U.S. pay scale saw their wages jump 6.7 percent from 2009 to 2017, according to the left-leaning Economic Policy Institute. Workers in the bottom 10 percent saw a boost of 7.7 percent, largely the result of a slew of minimum-wage increases passed on the city and state level. But for those in the middle, wages have been flat or even slightly down. African American workers, male workers and people who graduated from high school but never completed college have had an especially hard time.

(Wage data broken out by income group for 2018 was not available, but EPI economist Elise Gould said all signs indicate the trends have continued.)

Workers as a whole are getting a smaller share of the gains than they did the past. In the last boom era of the late 1990s and early 2000s, labor was getting more than 82 percent of corporate-sector income, according to EPI. Today it is less than 77 percent.

Some estimate that the frustration stretches back even further. Pew Research wrote in a report this week that, “despite some ups and downs over the past several decades, today’s real average wage has about the same purchasing power it did 40 years ago.”

“We are nearly a decade into the recovery and we’re still arguing about whether or not we’re seeing meaningful gains in wages. That should be a given at this point in the cycle,” said Lindsey Piegza, the chief economist at Stifel, an investment firm.

Numerous polls and surveys say Americans are more confident about the economy and their ability to get jobs, but many workers are wondering why their pay isn’t higher at a time when so much in the economy seems to be going well.

“I’m just a regular Joe, but I see that Fortune 500 companies are raking it in and the stock market is at an all-time high. Pay should be going up, too,” said Morris Tate, at 36-year-old who works for a logistics company in North Carolina.

There is no consensus explanation for why wage gains have not materialized.

Some economists think it is an aftereffect of the Great Recession, when workers were grateful to be employed and hesitant to agitate for more earnings at a time when they could be replaced with candidates from the glut of unemployed people looking for work. Now, with employers struggling to fill open positions, many employees have either not realized their newfound leverage or have been hesitant to use it, according to Gould.

“Workers don’t feel like they have the power to ask for higher wages, and employers still feel like they don’t have to pay more,” she said.

Other economists says a lack of growth in productivity is the reason for low pay: Employers do not want to pay more if workers are not producing more. Some experts also point out that the cost of benefits such as health care has been climbing, meaning some employers may be paying more for benefits even though they are holding down hourly pay.

Without raises, workers are opting to work more hours to stay afloat. The Labor Department reported that Americans are putting in more time on the job this summer vs. last summer, which is helping to keep family earnings about the same for now.

Penny Harford, a 67-year-old in Filer, Idaho, thought she would be retired by now. Instead, she’s working two part-time jobs at retail stores. She took on the second job last year as energy prices started to climb and she realized she needed more hours to pay bills.

Harford says she prides herself on being “budget conscious,” adding that she cooks her meals and will not use credit cards. But she says that with one job paying $12.65 an hour and the other paying $11, getting ahead is hard.

“I was talking with my co-workers yesterday,” she said. “We’re all desperate for more hours because we can’t make it.”

Heather LongHeather Long is an economics correspondent. Before joining The Washington Post, she was a senior economics reporter at CNN and a columnist and deputy editor at the Patriot-News in Harrisburg, Pa. She also worked at an investment firm in London. Follow