WASHINGTON — The economic rebound in the second quarter was stronger than previously estimated, another sign of a recovery gaining momentum after stalling early in the year.

The Commerce Department said Thursday that gross domestic product, the broadest measure of economic activity, expanded at a robust annual rate of 4.2 percent in the April-to-June period, up from the initial estimate of 4 percent growth.

Inflation-adjusted GDP contracted 2.1 percent in the first quarter, a result that analysts attributed largely to the harsh winter.

While the upward revision was modest, details of the report suggested more strength for the second half of the year.

There was a bigger boost from business investment on buildings and equipment, while companies' spending to bolster inventories was smaller than previously thought, which means potentially more stockpiling of goods in the current quarter.

Moreover, second-quarter growth in after-tax personal income was revised higher, to 4.2 percent from 3.8 percent, which bodes well for consumer spending.

With the unusually weak first quarter, GDP growth in the first half averaged only 1 percent at an annual rate.

Most analysts expect GDP in the second half to expand about 3 percent, but that will still leave growth for the full year at around 2 percent, similar to the slow pace throughout the 5-year-old recovery.

Even so, there have been encouraging signs of late. Surveys show greater confidence on the part of consumers and businesses. And significantly, the labor market has strengthened this year, with job growth accelerating and the unemployment rate dropping, raising hopes of higher earnings to come that could spur more spending.

On Thursday, the Labor Department said new jobless claims fell last week to 298,000, a drop from a revised 299,000 the previous week and 336,000 a year ago.

Initial filings for unemployment benefits seldom fall below 300,000.

The recent trend indicates that while most workers have yet to enjoy significant wage gains, their jobs appear to be more secure as company layoffs have become a less-common occurrence.