Demand for toys has so far withstood the decades-high inflation that has pummeled discretionary spending across America's largest retailers and raised fears of a recession.

Rival toymaker Hasbro Inc also posted strong quarterly results earlier this week, leaning on higher prices and a raft of product launches such as new Nerf blasters.

Mattel's net sales jumped 20% to $1.24 billion in the second quarter, higher than analysts' estimates of $1.10 billion, according to Refinitiv IBES data.

The company is also planning more price increases in the coming months to counter rising costs of raw materials, freight and labor.

However, Chief Executive Officer Ynon Kreiz said he was confident that toy sales would hold up even in a potential economic downturn, echoing comments from his counterpart at Hasbro.

"The toy industry is resilient and growing and performing well. We expect to gain share this year, and to outperform the industry," Kreiz told Reuters.

Mattel said overall gross billings for its Hot Wheels toys rose 26% in the second quarter ended June 30, while the unit that makes action figures recorded a 44% jump, helped by demand for toys based on characters from the "Masters of the Universe" and "Jurassic World" franchises.

Still, the Barbie doll maker reiterated its forecast for full-year sales and earnings as the hit from a stronger dollar offset the boost from a robust second quarter.

The company reported adjusted profit of 18 cents per share, up from 3 cents a year earlier.

(Reporting by Uday Sampath Kumar and Ananya Mariam Rajesh in Bengaluru; Editing by Devika Syamnath)

By Ananya Mariam Rajesh and Uday Sampath Kumar