U.S. consumer confidence hit a three-year high in February, suggesting the economy remained on a solid footing despite soaring gasoline prices.

The rise in sentiment was a hopeful sign for the economic recovery after the government said on Friday that growth in the fourth quarter was not as robust as it previously estimated.

The Thomson Reuters/University of Michigan survey's index on consumer sentiment climbed to 77.5, the highest since January 2008, from 74.2 in January -- indicating consumers were weathering higher gasoline prices for now amid optimism about the labor market.

Consumers do appear to be taking the rise in gasoline and food prices in stride, which is very encouraging, said Ryan Sweet, a senior economist at Moody's Analytics in West Chester, Pennsylvania. I wouldn't be surprised if we had a few bumps along the road, but I do think the consumer will continue to play an important role in the recovery.

Gross domestic product grew at an annualized rate of 2.8 percent in the fourth quarter, the Commerce Department said, a downward revision from its initial 3.2 percent estimate a month ago. Economists had expected GDP growth to be revised up to a 3.3 percent pace.

Political unrest in Libya and parts of the Middle East has pushed crude prices above $100 a barrel, sparking fears among some economists that growth could slow this year.

Economists at JPMorgan lowered their forecast for first-quarter GDP growth to 3.5 percent from 4.0 percent, citing softer-than-expected consumer spending and possible headwinds from the oil price spike. Harsh winter weather is also seen as a factor weighing on growth.

Richmond Federal Reserve Bank President Jeffrey Lacker said on Friday he did not think oil above $100 a barrel or gasoline over $3 a gallon would derail the U.S. recovery.

So far this seems quite manageable, he said on CNBC. The real danger is in inflation psychology. I think as long as expectations are managed well, we're going to get through this without a burst in inflation.

The national price for gasoline rose almost five cents this week to an average $3.19 a gallon, the most expensive since October 6, 2008.

STATE, LOCAL GOVERNMENT A DRAG

Turmoil in Libya and fears the oil spike could dent growth drove investors into safe-haven U.S. government bonds, pushing prices up and yields lower.

Brent crude, however, eased off 2-1/2-year highs, helping U.S. stocks to rebound after a week-long sell-off. The dollar rose against a basket of currencies.

The economy expanded at a 2.6 percent rate in the third quarter and grew 2.8 percent for the whole of last year.

The government's measure of fourth-quarter growth was lowered to reflect a contraction in government spending that was more than double the initial estimate.

Spending by state and local governments, which are under heavy budgetary pressures, shrank 2.4 percent. In all, government spending lopped 0.31 percentage point from GDP growth.

Growth in consumer spending -- which accounts for more than two-thirds of U.S. economic activity -- was trimmed to a 4.1 percent rate from 4.4 percent. It was still the fastest since the first three months of 2006 and an acceleration from the third quarter's 2.4 percent rate.

It validates the view that the most significant player in the economy is gradually coming back, but is doing so in a restrained fashion, said Patrick O'Keefe, director of economic research at J.H. Cohn in Roseland, New Jersey.

The pace of growth was too slow to do much to lower the unemployment rate, which fell during the quarter from 9.6 percent to 9.4 percent. It fell again in January to reach 9 percent.

Fed officials have been concerned the economy is expanding too slowly to bring unemployment down significantly. They are likely to view high oil prices primarily as a risk to growth rather than a long-term inflation concern.

Fed Chairman Ben Bernanke testifies to Congress on Tuesday and Wednesday, and analysts think he is unlikely to suggest much appetite within the central bank for scaling back a $600 billion government bond-buying program launched in November.

The GDP report also showed some upward revisions to business investment, but there were surprise downward tweaks to spending on equipment and software.

It also confirmed that the accumulation of inventories by businesses slowed sharply in the fourth quarter, taking a big bite out of GDP growth. Excluding inventories, the economy expanded at a 6.7 percent pace rather than 7.1 percent.

The expansion marked the biggest increase in domestic and foreign demand since 1998. In contrast, domestic purchases grew at a much more moderate 3.1 percent rate.

Exports were revised higher, but the upward revision to imports was even greater. In all, trade added 3.35 percentage points to GDP growth.

GDP growth is likely to accelerate in the first quarter. Business equipment and software spending should accelerate, exports will have another good quarter, and inventory accumulation should rebound, said Nigel Gault, chief U.S. economist at IHS Global Insight in Lexington, Massachusetts.

The report confirmed a pick-up in inflation pressures on surging food and gasoline prices. The personal consumption expenditures index rose at a 1.8 percent rate.

But a core price index closely watched by the Fed advanced just 0.5 percent, the smallest gain on record.

(Additional reporting by Emily Kaiser; Editing by Dan Grebler and Chizu Nomiyama)