Retail sales rose in July in a hopeful sign for the economy, but the gains were concentrated in auto and gasoline station sales, suggesting underlying momentum in consumer spending remains tame.

Sales climbed 0.4 percent last month following a revised 0.3 percent drop in June, the Commerce Department said on Friday. Economists polled by Reuters had been looking for a slightly firmer 0.5 percent gain.

Excluding vehicles, sales advanced just 0.2 percent compared with a median forecast of 0.3 percent. Gasoline station receipts, which sometimes reflect price rises rather than increased demand, jumped 2.3 percent. When autos and gasoline were stripped out, sales actually fell 0.1 percent.

After emerging from its longest slump since the Great Depression, the U.S. economy has slowed in recent months, raising fears of a double-dip recession. Retail sales are a key component of growth for a country where consumer spending makes up about two-thirds of total economic activity.

(Reporting by Pedro Nicolaci da Costa; Editing by Andrea Ricci)