After a 1.6 percent decline in the first three months of the year, the Commerce Department report said the 0.9% slowdown in the latest quarter was largely due to drops in government spending at all levels, in private investment on goods including autos, and on residential buildings, despite an increase in exports.
But personal consumption expenditures (PCE) continued to increase, though at a slower rate than the prior quarter, the data showed.
U.S. President Joe Biden insisted that the US economy is "on the right path" despite the slowdown, touting the strong labor market.
"That doesn't sound like a recession to me," he said in remarks at the White House, noting unemployment at near record lows and more than a million jobs created in the latest quarter.
After inflation soared, notably in the second quarter, The US central bank has raised interest rates aggressively - with the latest big hike on Wednesday - to try to cool the economy and tamp down price pressures.
"It's no surprise that the economy is slowing down as the Federal Reserve acts to bring down inflation," Biden said in a statement shortly after the GDP report was released.
"But even as we face historic global challenges, we are on the right path and we will come through this transition stronger and more secure," he said.
But the president's critics are sure to seize on the report as proof of the veteran Democrat's mismanagement.
"The government just announced what every American has been feeling for nearly a year -- we are in a recession," House Republican leader Kevin McCarthy said on Twitter. "Democrats would rather redefine a recession than restore a healthy economy."
But Fed Chair Jerome Powell agreed with Biden and other economists who say the GDP figures are inconsistent with other strong data.
Powell on Wednesday said he does not think the country is currently in a recession because "there are too many areas of the economy that are performing too well."
Powell also said it is possible to cool price pressures without causing a downturn or a big jump in joblessness, although he acknowledged the path to threading that needle is narrowing.
Mike Fratantoni, chief economist of the Mortgage Bankers Association, was among those who echoed Powell's view, saying: "The ongoing strength in the job market and other signs of growth make it unlikely that this will be categorized as a recession."
But economist Mohamed El-Erian said on Twitter that the data points to "deepening stagflation and flashing red recession risk."
Wall Street was initially not happy with the data, but stocks rebounded and ended the day with solid overall gains of more than one percent.