The pace of growth in U.S. manufacturing picked up for the first time in four months in June, surprising investors and fueling optimism the recent economic slowdown will be temporary.

The picture that emerged from other data released on Friday, however, was less encouraging. Although lower gasoline prices helped temper the gloomy mood among consumers last month, their expectations on the economy remained bleak, according to a survey.

While manufacturing has been a sweet spot in the economic recovery, consumer spending -- which accounts for roughly 70 percent of U.S. economic activity -- has failed to return to robust levels.

In a sign of lackluster consumer spending, both Ford and General Motors Co reported June U.S. sales that rose less than expected. GM automaker also tempered its full-year forecast for the industry, saying some consumers were still holding back on buying cars.

But the manufacturing report eased fears that the U.S. economic recovery could remain sluggish, though some economists cautioned it was too soon to tell if economic growth had turned a corner.

Globally the picture was less cheerful, with purchasing managers' indexes in Asia and Europe sliding to multi-month lows last month.

A fall in U.S. construction spending in May to a more than 10-year low also tempered the economic outlook.

Many economists and the Federal Reserve, which ended its latest round of monetary stimulus on Thursday as the second quarter ended, have maintained that obstacles to growth in the first six months of the year were temporary.

Forecasters see second-quarter growth at around 2 percent, after the economy grew at a 1.9 percent pace in the first three months of the year.

The biggest headwinds -- high energy prices and supply chain disruptions due to Japan's March earthquake -- have shown signs of easing. Japan reported earlier this week that factory output registered the biggest jump in almost 60 years in May as manufacturers restored supply chains.

GM's U.S. sales chief, Don Johnson, on Friday said the impact from the Japan crisis was the main driver of June's disappointing auto sales results, noting the impact on inventory.

The Institute for Supply Management said its index of national factory activity rose to 55.3 from 53.5 the month before, when it had slumped to its lowest level since September 2009. The reading topped expectations for 51.8, according to a Reuters poll of economists.

A reading above 50 indicates expansion in the manufacturing sector, while a number below 50 means contraction.

It indicates perhaps the biggest weakness will be in May, said Michael Gapen, chief U.S. economist at Barclays Capital in New York. It sets the groundwork for acceleration in growth for the second half of the year.

U.S. stocks were higher in the afternoon and were on track to record their best week in a year, as the manufacturing report and other data in recent days buoyed sentiment on the economy. Treasury prices tumbled.

One of the biggest factors behind the increase in the pace of growth was a jump in inventory building by manufacturers, which some economists said could be a sign of confidence that the U.S. economic recovery would gather speed later this year.

The employment gauge also rose, but new orders increased only slightly, and exports fell.

Ian Shepherdson, chief U.S. economist at High Frequency Economics, said the details of the report were baffling. The areas of strength in the report seemed at odds with the drop in new orders in recent months, which could lead to a fall in the main index next month, he wrote in a note.

The prices paid index fell to its lowest since August 2010, further easing concerns about inflation.

Although employment prospects looked a bit brighter, the closely watched U.S. payrolls report for June is not expected to show a big pickup in jobs growth. It is due to be released on July 8.

Separate data on consumers was less encouraging as sentiment worsened in June. Falling gasoline prices stabilized consumers' view of their current economic conditions, but longer-term expectations remained subdued, the Thomson Reuters/University of Michigan survey showed.

While small spending gains can be expected in the second half of the year, the trend is more likely to vary between lackluster and zero than lackluster and robust over the next several years, the survey said.

The final reading for the consumer sentiment index came in at 71.5, down from 74.3 the month before, a hair below the preliminary June figure of 71.8.

Some consumers have decided to sit on their hands and delay their purchasing, GM's Johnson, told reporters on a conference call, adding that the lull is expected to be temporary.

Also on Friday, the Economic Cycle Research Institute, a New York-based independent forecasting group, said its measure of future U.S. economic growth fell to a 29-week low in the latest week.

(Additional reporting by Alexandra Alper in New York and Deepa Seetharaman and Ben Klayman in Detroit; Editing by Leslie Adler)