WASHINGTON (AP) — The U.S. economy looked more resilient Wednesday after reports showed factories produced more goods in July and homebuilders grew more confident in the housing recovery.

At the same time, consumer prices stayed flat last month. Low inflation could boost consumers spending and lift growth in the second half of the year.

Economists approached the mostly positive data with some caution. The economy remains weak after a sluggish spring. And a severe drought in the Midwest could send food prices surging later this year and crimp consumer spending.

Still, the gains were encouraging. And they followed other July reports that showed consumers stepped up retail spending and employers created the most jobs since February.

— Factories made more cars, computers and airplanes last month, the Federal Reserve said. That helped drive industrial production, which includes output at factories, mines and utilities, up 0.6 percent in July from June, the fourth straight increase.

— Homebuilder confidence rose in August to a five-year high, according to the National Association of Home Builders/Wells Fargo sentiment index. The index rose to 37 from 35 in July. While that's well below 50, the dividing line between positive and negative sentiment about the housing market, the index has been trending higher since October. And in August, many builders reported seeing their best sales level since February 2007.

— Consumer prices were unchanged in July from June, the Labor Department said. A small drop in energy costs offset slightly higher food prices. The consumer price index hasn't increased since March, evidence that the weak economy is keeping inflation in check.

"The rising industrial production numbers, the home builders improving outlook, low consumer inflation and many of the other recent data indicate that economic conditions are actually getting better," said Joel Naroff, chief economist at Naroff Economic Advisors.

Factory output, the most important component of industrial production, rose 0.5 percent in July. It was the second straight monthly increase. The gain was driven by a 3.3 percent surge in output of motor vehicles and parts.

Factory production has risen 21.9 percent since its recession low hit in June 2009 and is just 1.7 percent below the pre-recession peak for factory output reached in April 2007.

Still, manufacturing slowed this spring as consumers cut back on spending and businesses invested less in machinery and equipment. Some worry that manufacturing could weaken further in coming months if Europe's financial crisis and slower global growth cut demand for U.S. exports.

"Despite the deteriorating global backdrop, U.S. manufacturing continues to expand," said Paul Ashworth, chief U.S. economist at Capital Economics. "Manufacturing is hanging in there, but the question is for how much longer?"

Adding to those worries was a survey from the Federal Reserve Bank of New York that showed manufacturing in the region shrank in August. The Empire State index fell to -5.9, down from a reading of 7.4 in July.

And economists noted that a big reason factory output rose was because automakers kept production lines humming in July, mostly skipping their normal summer shutdowns.

Inflation has stayed tame, another positive sign for growth. When inflation is low, consumers have more money to spend. Consumer spending drives roughly 70 percent of growth.

Lower inflation also gives the Federal Reserve more leeway to launch new programs intended to boost growth. The Fed signaled at a meeting in late July that it is ready to act if growth and hiring stay weak. That led many economists to predict the Fed would announce a third round of bond purchases designed to push long-term interest rates down and generate more borrowing and spending in the economy.

Overall, consumer prices increased just 1.4 percent in the 12 months ending in July. That's the smallest yearly increase in 20 months.

But low prices may not last much longer.

The drought in the Midwest has damaged corn, soybeans and other crops, which will likely push up a range of food prices on grocery store shelves in the coming months.

Corn is used in many processed foods, from cereals to soda. And both corn and soybeans are used in animal feed, so higher costs for those grains will likely push up meat prices.

Gas prices have also increased recently after falling from a peak near $4 a gallon in April. The average national price for gas was $3.71 a gallon on Wednesday. That's up 31 cents from a month ago.

"It was generally expected that July would be a decent month ... but uncertainty lies ahead," Jennifer Lee, an economist at BMO Capital Markets, said in an email to clients.


AP Business Writers Martin Crutsinger in Washington and Alex Veiga in Los Angeles contributed to this report.