The U.S. economy grew faster than initially thought in the second quarter on solid domestic demand, showing fairly strong momentum that could still allow the Federal Reserve to hike interest rates this year.

Gross domestic product expanded at a 3.7 percent annual pace instead of the 2.3 percent rate reported last month, the Commerce Department said on Thursday in its second GDP estimate.

The GDP report, which was released in the wake of a global stock market sell-off, should offer assurance to both investors and cautious Fed officials that the United States was in good shape to weather the growing strains in the world economy.

Concerns over slowing economic growth in China sent global equity markets into a tailspin last week, raising doubts that the U.S. central bank would raise its short-term interest rate next month.

On Wednesday, New York Fed President William Dudley said that prospects of a September lift-off in the central bank's key lending rate "seems less compelling to me than it was a few weeks ago."

The upward revisions to second-quarter growth also reflected the accumulation of $121.1 billion worth of inventories, up from the previous estimate of $110 billion. That meant inventories contributed 0.22 percentage point to GDP instead of subtracting 0.08 percentage point as reported last month.

Read More Why Trump's protectionist ways will hurt the economy



While the huge inventory build will likely weigh on growth in the third quarter, the blow could be softened by rebounding business investment on capital goods.

Economists polled by Reuters had expected that second-quarter GDP growth would be revised to a 3.2 percent rate.

Underscoring the economy's solid fundamentals, a measure of private domestic demand, which excludes trade, inventories and government expenditures, increased at a 3.3 percent rate, instead of the previously reported 2.5 percent pace.

Read More The Fed should still hike rates in September



Consumer spending, which accounts for more than two-thirds of U.S. economic activity, grew at a 3.1 percent rate, rather than the 2.9 percent pace reported last month. Consumer spending got off a to brisk start in the third quarter, with retail sales rising solidly in July.

A strong labor market, cheaper gasoline and relatively higher house prices, which are boosting household wealth, are helping to support consumer spending.