Shoppers walk among luxury brand stores at the Stanford Shopping Center in Palo Alto, Calif. (Nick Otto/For The Washington Post)

The U.S. economy expanded at a strong 3.2 percent annualized rate in the first quarter of 2019, the government reported Friday, blowing past expectations and prompting celebration among President Trump and his advisers.

Better-than-expected growth, ongoing strength in the job market, and a new all-time high in the stock market this week are tamping down fears of a recession and inviting comparisons of the current economy to the record 1990s boom.

Trump has tied the success of his presidency to jobs and the performance of the stock market, which can oscillate widely but is currently on the upswing, with the Standard & Poor’s 500-stock index closing the week at a new high.

“We’re knocking it out of the park,” Trump said Friday before a speech at a National Rifle Association convention in Indianapolis. “We have great growth and also very, very low inflation. Our economy is doing great.”

Many economists had predicted anemic growth at the start of the year, as the partial government shutdown, market jitters and extremely cold weather caused many businesses and consumers to hit the pause button on big purchases. But forecasters raised their estimates as it became clear some one-time factors would temporarily lift the economy.

Over half the growth in the first quarter was driven by an unusually low trade deficit and a surge in inventories, with companies beefing up their supplies after depleting them last year.

“It was impressive GDP until you dig into some of the numbers,” said Lindsey Piegza, chief economist at Stifel Fixed Income. She pointed to a key gauge of consumer and business demand — final sales to private domestic purchasers — which was just 1.3 percent, the weakest in more than three years.

Economists are divided about how the economy is likely to perform the rest of this year and early next year, a time when many Americans are likely to form their opinions on how Trump’s economy is doing ahead of the 2020 election.

Some experts, including at the Federal Reserve, forecast growth will slow to about 2 percent, similar to the Obama years, while other see growth sticking closer to 2.5 percent, which would be noticeably above trend. But there is broad agreement that a recession looks increasingly unlikely ahead of the election in November.

In some ways today’s economy feels like 1998 or 1999, with robust growth, low unemployment and meager inflation that shows few signs of spiking. Confidence in the economy is high, and the stock market, much like in the late 1990s, has been on a bullish ride led by technology stocks.

“It looks like the Goldilocks scenario of strong growth and benign inflation is still happening, much like the 1990s,” said Neil Dutta, head of economics at Renaissance Macro Research.

More Americans appear to be feeling the gains, with 53 percent of consumers saying they have personally experienced an improvement in their finances in the past month, according to the University of Michigan Survey of Consumers released Friday, the highest average since 1999.

Gallup polling found similar results with half of Americans giving the economy an “excellent” or “good” rating lately, the most upbeat assessment since 2001.

But there are two major differences between the current economy and that of the late 1990s that could worry policymakers: Inequality is higher now, and the government is far more constricted in its ability to act if a downturn hits.

“Another recession will surely come at some point and we are going to enter that next recession in a difficult position,” said Christina Romer, an economics professor at the University of California at Berkeley and former head of President Barack Obama’s Council of Economic Advisers.

The federal government is on track to run a deficit of nearly $1 trillion this year because of government spending and Trump’s tax cuts, setting up a highly unusual situation of piling on debt in good economic times. The United States is the only major economy projected to increase its debt as a percentage of GDP over the next five years, according to the International Monetary Fund, which could make it more challenging to increase federal spending in a crisis.

The other typical response in times of trouble is for the Federal Reserve to cut interest rates, but there is much less scope to do that now than there was 20 years ago.

In the late 1990s, interest rates were sitting at about 5 percent. Today, they are just shy of 2.5 percent, and Trump has been calling for further reductions, blaming“high” interest rates for holding back growth.

“If we kept the same interest rates and the same quantitative easing that the previous administration had, that 3.2 would have been much higher than that,” Trump said Friday.

Wage growth, though higher over the past year, is also below the levels of the late 1990s, when wages were growing 4 percent a year because of massive technology investment that boosted productivity.

“Today’s economy is not anywhere close to the late 1990s,” said Joseph Brusuelas, chief economist at accounting firm RSM. “We are not seeing the increases in productivity and wages that we saw in that period when everyone called Alan Greenspan the ‘maestro.’ ”

While wages for many lower-income Americans are rising faster than the cost of living as companies boost wages to attract and retain workers, inequality has been rising. Wealthy Americans are benefiting far more from rising stocks and home prices than the working class, many of whom do not own their homes or have much, if any, invested in the market.

How voters weigh these economic issues against other considerations at the ballot box remains to be seen.

Trump has vowed he can get the U.S. economy growing at an annual pace of 3 percent — or better — for the next decade, a scenario independent forecasts don’t believe is achievable.

But the president’s top economic advisers say they are revising their growth forecasts even higher after examining the data. They believe growth would have been 3.5 percent in the first quarter without the shutdown and that consumption will pick up later this year.

“Right now we would be inclined to increase our forecasts. Not only was last year not a sugar high, but it appears the economy is accelerating,” Kevin Hassett, head of Trump’s Council of Economic Advisers, said in an interview.

First-quarter growth is typically the weakest of the year, but this year could unfold differently as the one-time effects fade.

“The first-quarter number is overstating the strength of the economy,” said Ben Herzon, executive director at Macroeconomic Advisers. “Businesses were building inventories like crazy. That is not going to last.”

After a big buying spree in the winter, companies are unlikely to keep expanding their inventory this spring, meaning second-quarter growth could take a hit. The unusual jump in U.S. exports is also likely to be hard to sustain. If the trade deficit widens in the second quarter, that would also be a drag on growth.

A jump in state and local government spending also boosted first-quarter growth by the biggest amount in three years.

U.S. consumers are likely to be the key factor in whether the economy has a normal, subpar or extraordinary year, because consumer spending drives about 70 percent of growth.

Americans sharply pulled back spending at the end of last year, but there are signs they started buying again in March, which should create a spring bounce to keep the economy expanding at a decent pace. For the past several years, this trend has played out with weaker spending in the first quarter and stronger spending in the spring and summer.

Hassett said the president’s top economic priority now is closing trade deals with China and Europe and getting Congress to pass the U.S.-Mexico-Canada Agreement, the revised North American trade deal.

The International Monetary Fund recently predicted growth would pick up in the second half of the year for the world economy and likely the United States, propelled by the expected resolution of the U.S.-China trade war and the Fed’s decision to hold off on raising interest rates.

“The economy is not slowing nearly as much as people think,” said Dutta of Renaissance Macro Research. “A 3.2 percent pace cannot be sustained, but the Federal Reserve and markets have probably cut their growth estimates too far for this year.”