April 24 (Reuters) - Hasbro reported a smaller-than-expected drop in first-quarter sales and handily beat profit estimates on Wednesday, as leaner inventories and steady digital gaming revenue helped cushion a drag from softer demand for toys.

The Play-Doh maker has grappled with weakening demand over the past year amid a pullback in discretionary spending and tight inventory planning by mass retailers like Walmart and Target.

However, efforts to clean up its inventory throughout 2023, along with cost efficiencies, helped its operating margin expand to 15.3%, from 1.8% last year.

Revenue for the Wizards of the Coast and Digital Gaming segment grew 7% in the quarter, driven by the popularity of its "Baldur's Gate III" and "Monopoly Go!" games.

The Nerf toy gun maker's quarterly revenue fell 24.3%, to $757.3 million, smaller than the 26.2% drop to $738.6 million estimated by analysts' on average, according to LSEG data.

On an adjusted basis, Hasbro reported earnings per share of 61 cents in the quarter ended March 31, compared to 1 cent last year. Analysts on average had expected 27 cents per share.

The toy maker said it was on track to achieve the fiscal 2024 targets it set in February.

On Tuesday, Barbie maker Mattel posted a smaller-than-expected loss for the first quarter, helped by its costs-saving measures. (Reporting by Savyata Mishra in Bengaluru; Editing by Pooja Desai)