WASHINGTON (AP) — The U.S. economy surged in the April-June quarter to an annual growth rate of 4.1 percent. That’s the fastest pace since 2014, driven by consumers who began spending their tax cuts and exporters who rushed to get their products delivered ahead of retaliatory tariffs.
The Commerce Department reported Friday that the gross domestic product, the country’s total output of goods and services, posted its best showing since a 4.9 percent gain in the third quarter of 2014.
President Donald Trump is predicting growth will accelerate under his economic policies. But private forecasters cautioned that the April-June pace is unsustainable because it stems from temporary factors. The rest of the year is likely to see good, but slower growth of around 3 percent.
Trump, who has repeatedly attacked the economic record of the Obama administration, pledged during the 2016 campaign to double growth to 4 percent or better.
‘‘It’s only going to get better,’’ the president said Thursday during a trip to Iowa and Illinois.
The latest GDP figure was nearly double the 2.2 percent growth rate in the first quarter, which was revised up from a previous estimate of 2 percent growth.
Consumer spending, which accounts for 70 percent of economic activity, rebounded to a 4 percent annual growth rate after turning in a lackluster 0.5 percent gain in the first quarter. Consumers began spending their increased take-home pay on autos and other big-ticket items, spurred by the $1.5 trillion tax cut Trump pushed through Congress in December.
Forecasters expect healthy consumer spending in the second half of this year but a slower pace than in the spring.
Another factor that bolstered the second quarter was a rush by exporters of soybeans and other products to get their shipments to other countries before retaliatory tariffs in response to Trump’s get-tough trade policies took effect. Exports rose at a 9.3 percent rate in the second quarter, while imports grew at a tiny 0.5 percent rate.
The narrowing trade deficit added a full percentage-point to growth in the second quarter, though economists are concerned that a full-blown trade war between the United States and China, the world’s two biggest economies, will hurt growth going forward.
Business investment grew at a solid 7.3 percent rate in the second quarter. Government spending also posted a solid gain, rising at a 2.1 percent rate. The result was boosted by a budget deal at the beginning of this year that added billions to defense and domestic spending. But housing, which has struggled this year, shrank at a 1.1 percent rate after an even bigger 3.4 percent decline in the first quarter.
‘‘The second quarter was a strong quarter, but it was juiced up by the tax cuts and higher government spending,’’ said Mark Zandi, chief economist Moody’s Analytics.
Zandi forecast that growth for 2018 will hit 3 percent, the best annual growth rate in over a decade. In 2019, he expects a solid 2.6 percent growth rate. But in 2020 — a presidential election year — Zandi said he is forecasting economic growth of just 0.9 percent, a pace that is so slow that it will raise the threat of a recession.
‘‘We will come pretty close to stalling out in 2020 because the growth we are seeing now is not sustainable,’’ Zandi said.
The GDP report released Friday included a benchmark revision of the past GDP numbers. That revision showed that growth in 2017 came in at 2.2 percent, slightly lower than the 2.3 percent previously reported.
The current expansion, which began in June 2009 and is now the second longest in history, has also been the weakest. The GDP revisions did not change that story. Growth has averaged just 2.2 percent since mid-2009 through the end of last year, the same as previously reported.