US President Barack Obama gives the thumbs up as he walks out of the White House in Washington on October 7, 2012 before departing for a campaign swing in California. AFP PHOTO/Nicholas KAMM (Photo credit should read NICHOLAS KAMM/AFP/GettyImages)

WASHINGTON, July 30 (Reuters) - U.S. economic growth accelerated more than expected in the second quarter and the decline in output in the prior period was less steep than previously reported, which could bolster views for a stronger performance in the last six months of the year.

Gross domestic product expanded at a 4.0 percent annual rate as activity picked up broadly after shrinking at a revised 2.1 percent pace in the first quarter, the Commerce Department said on Wednesday.

That pushed GDP above the economy's potential growth trend, which analysts put somewhere between a 2 percent and 2.5 percent pace. Economists polled by Reuters had forecast the economy growing at a 3.0 percent rate in the second quarter after a previously reported 2.9 percent contraction.

The economy grew 0.9 percent in the first half of this year and growth for 2014 as a whole could average above 2 percent. The first quarter contraction, which was mostly weather-related, was the largest in five years.

Employment growth, which has exceeded 200,000 jobs in each of the last five months, and strong readings on the factory and services sectors from the Institute for Supply Management underpin the bullish expectations for the rest of the year.

The government also published revisions to prior GDP data going back to 1999, which showed the economy performing much stronger in the second half of 2013 and for that year as a whole than previously reported.

LITTLE POLICY IMPACT

The GDP data, which was released only hours before Federal Reserve officials conclude a two-day policy meeting, is unlikely to have much sway on monetary policy as the U.S. central bank has already dismissed the first-quarter contraction in output as a weather-related anomaly.

Growth in the second quarter was driven mainly by consumer spending and a swing in business inventories.

Consumer spending growth, which accounts for more than two-thirds of U.S. economic activity, accelerated at a 2.5 percent pace, as Americans bought long-lasting manufactured goods and spent a bit more on services. Consumer spending had braked to a 1.2 percent pace in the first quarter because of weak healthcare spending.

Despite the pick-up in consumer spending, Americans saved more in the second quarter. The saving rate increased to 5.3 percent from 4.9 percent in the first quarter as incomes rose, which bodes well for future spending.

Inventories contributed 1.66 percentage points to GDP growth after chopping off 1.16 points in the first quarter.

The economy also received a boost from business investment, government spending and investment in home building.

Trade, however, was a drag for a second consecutive quarter as some of the increase in domestic demand was met by a surge in imports. Domestic demand rose at a 2.8 percent pace, the fastest since the third quarter of 2011. It increased at a 0.7 percent pace in the first quarter.

Solid demand underscores the economy's firming fundamentals.

With demand firming, price pressures picked up a bit in the second quarter, a welcome development for Fed officials who have long worried about inflation being too low.

A price index in the report rose at a 2.3 percent rate in the second quarter, the quickest in three years, after advancing at a 1.4 percent pace in the prior period.

A core measure that strips out food and energy costs increased at a 2.0 percent pace, the fastest since the first quarter of 2012. It had increased at a 1.2 percent rate in the first quarter. (Reporting by Lucia Mutikani; Editing by Paul Simao)