STOCKHOLM, Sept 15 (Reuters) - Sweden's H&M on Friday reported flat sales in its most recent quarter, lagging expectations as the fashion firm struggles to attract customers while the cost of living crisis drags on.

"The work towards the company's goal of reaching a 10% operating margin in 2024 is going in the right direction. Profitability and inventory levels have been prioritized in the quarter," H&M said in a statement.

The world's second biggest fashion retailer said June-August local-currency sales, the figure most closely watched, were "flattish" year-on-year, missing the 5% growth forecast by analysts in a Reuters poll.

Net sales rose 6% to 60.9 billion Swedish crowns ($5.45 billion), lagging the 63.5 billion expected by analysts.

Excluding its Russia, Belarus and Ukraine operations - it's Russian stores were temporarily open for part of the third quarter last year but have since shut - H&M's sales rose 8% measured in Swedish crowns, it said.

H&M has announced that it will begin reopening stores in Ukraine in November which were closed last year following Russia's invasion.

H&M had seen a reversal of fortune this year that lifted its share price by 53% as sales rose while cost cuts announced last year took effect, but faces competition from Zara owner Inditex and China-founded fast-fashion retailer Shein.

Inditex beat expectations with a 40% jump in half-year net profit on Wednesday even as the world's biggest fast fashion company slowed the pace of its price increases.

Inditex's sales in constant currencies increased 14% between Aug. 1 and Sept. 11, falling short of analysts' expectations for an 18% rise in a sign that the heatwave in Europe had dented demand for autumn and winter clothes.

($1 = 11.1635 Swedish crowns)

(Reporting by Marie Mannes, editing by Terje Solsvik and Jason Neely)