Households spent more at restaurants and on accommodation last month. There was also an increase in spending on prescription medication. Economists polled by Reuters had forecast consumer spending rising 0.4 percent in July.

The Commerce Department said on Thursday consumer spending, which accounts for more than two-thirds of U.S. economic activity, rose 0.4 percent last month after advancing by the same margin in June.

U.S. consumer spending increased solidly in July, pointing to strong economic growth early in the third quarter, while a measure of underlying inflation hit the Federal Reserve's 2 percent target for the third time this year.

When adjusted for inflation, consumer spending gained 0.2 percent in July after rising 0.3 percent in June.

Strong consumer spending helped fire up economic growth in the second quarter, with gross domestic product rising at a 4.2 percent annualized rate, almost double the 2.2 percent pace notched in the January-March quarter.

Solid consumer spending should blunt some of the impact on the economy from an anticipated widening in the trade deficit and weakness in the housing market in the third quarter. Recent data showed a sharp rise in the goods trade deficit in July as well as further declines in home sales and a moderate rise in homebuilding last month.

Consumer spending, which grew at a 3.8 percent annualized rate in the April-June period following a pedestrian 0.5 percent pace in the first quarter, is being supported by a robust labor market. Spending on goods rose 0.2 percent last month after slipping 0.1 percent in June. Outlays on services increased 0.4 percent after surging 0.6 percent in the prior month.

With demand rising last month, prices continued their gradual upward trend. The personal consumption expenditures (PCE) price index excluding the volatile food and energy components rose 0.2 percent after edging up 0.1 percent in June.

That lifted the year-on-year increase in the so-called core PCE price index to 2.0 percent from 1.9 percent in June. The core PCE index is the Fed's preferred inflation measure. It hit the U.S. central bank's 2 percent inflation target in March for the first time since April 2012.

Minutes of the Fed's July 31-Aug. 1 meeting published last week showed some policymakers worried "a prolonged period in which the economy operated beyond potential could give rise to inflationary pressures." The Fed is expected to raise interest rates for the third time this year in September.

In July, personal income rose 0.3 percent after increasing 0.4 percent in the prior month. Wages gained 0.4 percent. The saving rate slipped to 6.7 percent last month from 6.8 percent in June.