WASHINGTON (AP) — The U.S. economic landscape would look even bleaker if not for America's consumers.

The economy slowed in the spring, and many analysts think the weakness will continue in the months ahead. Yet consumer spending, which drives about 70% of growth, accelerated in the April-June quarter at the fastest pace in nearly five years.

Households are showing a willingness to keep spending even in the face of rising anxiety about a possible forthcoming recession. At the same time, though, business investment is weakening in the face of uncertainties created by the increased taxes that President Donald Trump has imposed on hundreds of billions of dollars' in imports — goods that many American businesses rely upon.

Despite the resilience consumers are showing, the overall economic picture is weakening. The gross domestic product, the broadest gauge of economic health, advanced at a moderate 2% annual rate in the April-June quarter, the government said Thursday, down from a 3.1% gain in the first quarter. Thursday's revised figure for last quarter was slightly lower than the government's initial estimate of 2.1% annual growth.

The slowdown could complicate Trump's hopes that a surging economy will enhance his 2020 re-election hopes. He is counting on rising wages and low unemployment to keep consumers spending.

The president has pledged to achieve annual growth at annual rates of 3% or better. But economists generally foresee GDP slowing sharply after hitting 2.9% last year. The general expectation is that annual growth in the current July-September quarter is weakening to around 1.8% and that the pace in the October-December quarter will be similar.

For all of 2019, economists estimate that GDP will slow to around 2.2 percent and then drop to below 2% in 2020 as the economy faces headwinds from the global slowdown and the uncertainties from Trump's escalating trade war with China.

The biggest factor in the government's downward revision for the April-June quarter was a smaller gain in spending by state and local governments and fewer export sales. American exports have been hurt by the retaliatory tariffs China and other countries have imposed on U.S. soybeans and other products. That drop was offset by the increase in consumer spending to a rate of 4.7%, up from an initial estimate of 4.3%.

Business investment spending turned negative in the second quarter, falling at a 0.6% annual rate, which many economists believe occurred because of the trade wars increasing business uncertainty about the future.

A slowdown in annual growth to 2.2% would be near the 2.3% annual gains seen since the decade-long expansion began in June 2009. The recovery became the longest in U.S. history last month but analysts have begun to worry whether trade wars, plunging stock markets and such factors as sluggish factory output and a tepid housing market might be signaling growing risks of a recession.

Trump contends that his economic program of tax cuts, deregulation and get-tough trade policies will produce sustained GDP growth of 3% a year or better, a big improvement on the 2.3% gains of the Obama years.

Private economists generally disagree. Most say they believe that growth accelerated last year because of Trump's tax cuts but that this boost is now fading. They are forecasting that growth will slow even further next year and they say a recession can't be ruled out.

A survey last week found that 74% of business economists now believe a new recession will begin by the end of 2021 with 38% saying the downturn will start even sooner, in 2020.

Mark Zandi, chief economist at Moody's Analytics, said he is not forecasting a recession in the next 18 months but he said one can't be ruled out with the greatest risk coming from Trump's trade war with China.

"If the president continues to ratchet up the rhetoric and his tariffs on China, it will continue to unnerve business people who are already being more cautious with their investment plans," Zandi said. "The risks of going into a recession are high if the president keeps escalating his trade war."

In a separate report Thursday, the Labor Department said the number of Americans filing claims for unemployment benefits, seen as a good proxy for layoffs, rose by 4,000 last week to a still-low 215,000. Economists believe this weekly indicator will be one of the first signs if the economy is starting to falter.

More From KGAB