The US economy slowed between March and June, but still grew at a healthy clip as solid consumer spending offset declining exports and business investments amid a threatened trade war with China.

The US gross domestic product dropped to 2.1 percent during the second quarter, down from 3.1 percent during the first three months of the year, the Commerce Department said Friday.

While that’s a modest drop from the first quarter, it’s still higher than the 2 percent that analysts had predicted.

Among the red flags: Business investment contracted for the first time in more than three years and housing declined for a sixth straight quarter.

Federal Reserve Chairman Jerome Powell early this month had called out the two sectors as areas of weakness in the economy. They’ll likely give additional cover for the Fed to cut interest rates next Wednesday for the first time in a decade.

“The key to future economic growth is business spending. Evidently, businesses do not share the ebullience consumers have,” Sung Won Sohn, an economics professor at Loyola Marymount University in Los Angeles, told Reuters.

The Fed is widely expected to cut its benchmark rate by a quarter of a point at its July 30-31 meeting.

More broadly, most economists weren’t concerned by the drop from the first quarter, since much of the strength in the beginning of the year came from businesses binging on buying goods ahead of a potential trade war with China.

“The first quarter had a lot of one-off supports. A lot of that was because of the trade war,” Lindsey Piegza, chief economist for Stifel Fixed Income, told The Post.

The second quarter was “a little stronger than expected, but still supporting the notion that growth is slowing from that first-quarter level,” she added.

President Trump used the announcement to harp on the Federal Reserve, which he has accused of keeping rates high in order to dampen economic growth.

“Not bad considering we have the very heavy weight of the Federal Reserve anchor wrapped around our neck. Almost no inflation. USA is set to Zoom!” Trump said on Twitter.

The Fed funds effective rate is 2.4 percent, which is historically low and about half of the historical average of 4.79 percent, according to the Federal Reserve Bank of New York.

The Fed will announce on July 31 if it plans on lower interest rates for the first time since December 2008.

Economists expect that the central bank will lower rates by 0.25 percent, with the possibility of further rate cuts in the future — effectively lowering the cost of borrowing money for consumers and businesses, making it cheaper to take out a mortgage or an auto loan.

While the White House has pushed for lower rates to “zoom” the economy, some economists have cautioned that cuts could hurt the economy during a future downturn.

“Rate cuts now sound like Washington politics at its worst. We didn’t need a tax cut with the economy not in a recession, and we don’t need an interest rate cut with the economy not in a recession either,” said Chris Rupkey, chief financial economist at MUFG bank.