NEW YORK - U.S. stocks closed higher on Thursday, with tech-related momentum stocks leading the charge, as fresh economic data rekindled hopes that inflation remains in a cooling trend.

Interest rate-sensitive megacaps gave the tech-heavy Nasdaq a decisive edge. The S&P 500 also closed in positive territory, while the Dow ended essentially unchanged.

The Producer Prices index (PPI) came in softer than expected, supporting the narrative that price growth is still cooling.

"The data this morning was mildly more supportive of sort of a benign 'soft landing' outcome than the data yesterday," said Brian Nick, senior investment strategist at Macro Institute. "I guess it feels like a natural kind of snapback from, what was potentially an overreaction yesterday."

On Wednesday, hotter-than-expected CPI data sent stocks sharply lower and benchmark Treasury yields to their highest level since November. The report doused hopes that the central bank could implement as many as three rate cuts before year-end, possibly starting as soon as its June policy meeting.

"There’s a suggestion that the inflation numbers the Fed really cares about - the PCE numbers - aren't going to be quite as dire as CPI," Nick added. "And the parts of the market that were most punished yesterday are having a bit of a comeback today."

While the PPI data was more encouraging, the data did indicate that inflation's journey down toward the central bank's annual 2% target might be too meandering for the Fed.

New York Fed President John Williams said "there's no clear need to adjust monetary policy in the very near term."

Richmond Fed President Thomas Barkin said the central bank is not yet confident pricing pressures will continue to ease.

"Investors are starting to absorb the possibility that maybe inflation could linger just a little bit longer and the Fed's going to continue to remain patient, which is their big word right now," said Joseph Sroka, chief investment officer at NovaPoint in Atlanta.

Investors now switch their focus to first-quarter earnings season, with results from three major U.S. banks - JPMorgan Chase & Co, Citigroup Inc, and Wells Fargo & Co - due Friday morning.

The Dow Jones Industrial Average fell 2.43 points, or 0.01%, to 38,459.08, the S&P 500 gained 38.42 points, or 0.74%, to 5,199.06 and the Nasdaq Composite added 271.84 points, or 1.68%, to 16,442.20.

Of the 11 major sectors in the S&P 500, tech was out front, while financial shares were the laggards.

The FANG+ index of megacap momentum stocks was a clear outperformer, gaining 2.6%. CarMaxslid 9.2% after the pre-owned vehicles retailer missed analysts' estimates for fourth-quarter results and said it might not meet its long-term vehicle sales target.

Globe Life tumbled 53.1% after Fuzzy Panda Research disclosed a short position in the company, alleging multiple instances of insurance fraud.

Rent the Runway skyrocketed by 161.9% after the apparel rental company said it was betting on artificial intelligence to power its current year growth.

Biotech firm Alpine Immune Sciences is to be acquired by Vertex Pharmaceuticals for about $4.9 billion in cash, both companies said. Alpine surged 36.9%.

Advancing issues outnumbered declining ones on the NYSE by a 1.12-to-1 ratio; on Nasdaq, a 1.23-to-1 ratio favored advancers.

The S&P 500 posted 11 new 52-week highs and 6 new lows; the Nasdaq Composite recorded 51 new highs and 135 new lows.

Volume on U.S. exchanges was 10.39 billion shares, compared with the 11.48 billion average for the full session over the last 20 trading days.

(Reporting by Stephen Culp; Additional reporting by Shashwat Chauhan and Shristi Achar A in Bengaluru; Editing by David Gregorio)