Wall Street closed sharply higher on Thursday after a raft of solid retail earnings and easing concerns about overly aggressive interest rate hikes by the Federal Reserve put investors in a buying mood.

All three major U.S. stock indexes posted solid gains, with economically sensitive consumer discretionary and microchip stocks beating the broader market.

On a weekly basis, the S&P 500, Nasdaq and Dow are on track to snap their longest losing streaks in decades, during which the benchmark S&P plummeted 14.1% and brought it within striking distance of being confirmed as a bear market.

At current levels, all three indexes are poised to notch their biggest weekly gains since mid-March.

"With first quarter earnings essentially over and coming in better than expected, combined with the Fed indicating that they are going to be front-end loading its rate-tightening policy and implying it may pause later in the fall, all of that has given investors reason to feel optimistic," said Sam Stovall, chief investment strategist at CFRA Research in New York.

Upbeat guidance from retailers appeared to offset dour warnings from their peers in recent weeks.

Shares of department store operator Macy's Inc jumped after it raised its annual profit forecast.

Discount chains Dollar General Corp and Dollar Tree surged, following their annual sales forecast hikes, suggesting consumers are shopping for less costly goods amid decades-high inflation.

The minutes from the Federal Open Market Committee's (FOMC) most recent monetary policy meeting calmed fears that the U.S. central bank could turn more hawkish, a concern which has fed into market volatility in recent weeks.

"We have had 65% more daily price moves of 1% or more than the average since WW2," Stovall said.

"If the Fed is too aggressive, they'll choke off inflation but also choke off economic growth," he added. "It's like in the winter you want to tap your brakes, not slam on them, to maintain control and avoid spinning out."

Economic data released on Thursday, including jobless claims, pending home sales and GDP, brought good news wrapped in bad, suggesting the economy is showing just enough softness to prompt a dovish pivot from the Fed by autumn.

According to preliminary data, the S&P 500 gained 79.51 points, or 2.00%, to end at 4,058.24 points, while the Nasdaq Composite gained 301.83 points, or 2.64%, to 11,740.46. The Dow Jones Industrial Average rose 520.20 points, or 1.62%, to 32,640.48.

Shares of Twitter Inc jumped on news that the social media company is suing billionaire Elon Musk for delayed disclosure of his stake in the company.

U.S.-listed shares of Alibaba Group rose after the Chinese e-commerce company beat estimates, even as it declined to provide forward guidance in view of COVID-19 restrictions in China.