Samsung has confirmed that it is recalling the Galaxy Note 7, its newest smartphone, following reports that some devices exploded.

The device was launched less than a month ago to very positive reviews, but concerns about the battery in some units — which reportedly combusted while charging — have forced the company’s hand. Yesterday, Samsung confirmed it was investigating the issue, and now it has taken quick action to avoid potential tragedies.

Samsung said it has sold 2.5 million devices so far, and it plans to replace them all in “the coming weeks.” It added that it is aware of 35 cases of faulty batteries, although it isn’t clear how many of that number had exploded.

Wow. Samsung has sold 2.5 million Galaxy Note 7's so far. Will replace all of them. That's going to cost… — Paul Mozur (@paulmozur) September 2, 2016

“We acknowledge the inconvenience this may cause in the market but this is to ensure that Samsung continues to deliver the highest quality products to our customers. We are working closely with our partners to ensure the replacement experience is as convenient and efficient as possible,” the company said.

The timing is particularly painful for the Korean firm, with arch-rival Apple set to unveil its latest iPhone next week. Any sales advantage that the Note 7 had will be wiped out, while there are obvious question marks around the safety of the device, too.

The Note 7 looked like being a continuation of positive progress for Samsung this year. Its Galaxy S7 and S7 Edge phones were released to glowing reviews earlier this year and impressive sales helped Samsung to its most profitable quarter for two years.

Rather than pushing things on, today’s confirmation of a recall leaves Samsung in a sticky position.

Here’s the confirmation in full: