FILE - In this March 6, 2019, file photo, container ships docked at the Port of Oakland wait to be unloaded in Oakland, Calif. The U.S. economy shook off fears of a sharp slowdown in the first quarter of the year and grew at a solid pace, suggesting the nearly decade-long expansion still has a ways to go. (AP Photo/Ben Margot, File)
FILE - In this March 6, 2019, file photo, container ships docked at the Port of Oakland wait to be unloaded in Oakland, Calif. The U.S. economy shook off fears of a sharp slowdown in the first quarter of the year and grew at a solid pace, suggesting the nearly decade-long expansion still has a ways to go. (AP Photo/Ben Margot, File) Credit: Ben Margot

WASHINGTON — The worries that hung ominously over the U.S. economy early this year appear to have lifted. And that sunnier picture has helped bolster confidence in the stock market — driving the benchmark S&P 500 index to another record high on Friday.

The latest dose of encouragement came in a report on Friday that the U.S. economy grew much faster than expected in the January-March quarter, suggesting that the nearly decade-long expansion still has a ways to go.

Other recent signs have fed a growing view among many analysts that the economy faces little risk of slipping into a recession anytime soon as some had feared when the year began. Retail sales jumped in March. And with hiring solid and wages rising at a decent pace, consumer spending will likely strengthen in the coming months.

In Friday’s report, the government said the economy grew at a 3.2% annual rate in the first quarter. That’s much better than the 1% or below rate that was forecast in the early weeks of 2019.

Though the economy is widely expected to slow in the current quarter to a roughly 2% rate or less, such a pace still would produce annual growth for the first half of the year of roughly 2.5%. That would be a solid gain. And it would be in line with the modest but steady growth that has prevailed for most of the expansion.

It’s also a far brighter scenario than the one envisioned late last year and early this year. A 35-day partial shutdown of the government remained in effect through most of January. Global growth was sputtering in the midst of the U.S.-China trade war. Stocks plummeted in December as the Federal Reserve raised short-term interest rates for the eighth time in nine quarters and signaled that further tightening was likely. Mortgage rates rose, discouraging many would-be home buyers.

American households also cut back: Retailers’ sales were weak in January and February, adding to the bleak outlook.

Share prices, though, began to rebound in January, after the Fed signaled that it had put any further rate increases on hold, likely for the rest of the year. That emboldened investors, who have become increasingly confident that the economy will avoid the worst-case scenario of a recession.

After falling nearly 20% at the end of last year, the S&P 500 has now recouped all its losses since late September.