Samsung, the South Korean electronics giant, was flying high as it prepared to launch the Galaxy Note 7 smartphone in late summer 2016. Already the world's largest smartphone maker, Samsung's move to phones with larger screens countered the perception that it wasn't as creative as its archrival Apple.
Reviews of the Note 7 - a 5.7-inch, stylus-toting high-end smartphone aimed at workaholics - glowed ahead of its August launch date.
Then disaster struck. Within weeks of the launch, Samsung's customers in South Korea reported that the phones were catching fire. Some had even exploded. By September 2, the company stopped producing the phone and was sending replacements. Its business was buckling: Samsung quickly lost $26 billion in value in the stock market.
It got worse. A U.S. government recall followed on September 12; a second came in October when the replacement units had the same incendiary issues. Analysts estimated the setback would cost the company $17 billion in sales, adding that if the crisis didn't sink Samsung's mobile business, it would almost certainly kill the Note line.
But now, just 18 months later, it seems that Samsung, and the rest of the world, have shrugged off the crisis. Its next phone - the Galaxy S9, set to debut on Sunday in Barcelona - is expected to be a foil to Apple's iPhone X. Most of the buzz about it centres on the quality of its camera rather than the integrity of its battery.
Somehow, the past two years at Samsung - which also saw the company's de facto chairman, Jay Y. Lee, arrested in a bribery scandal that took down South Korea's president - have not been its undoing. Its sales have rebounded. Last year, the electronics company reported a record $50 billion in profit.
Experts say a mix of factors - including Samsung's crisis response, its position in the global smartphone market and good timing for the worst possible news - helped it escape a crisis that could have set it back for years or even put it under.
"I have one word to describe Samsung," said Thomas Cooke, a professor at Georgetown University's McDonough School of Business. "Teflon."
The battery issues blindsided Samsung as it undertook the largest smartphone recall in history - 2.5 million phones, including 1 million in the United States.
Samsung's initial reaction to the battery crisis will probably become "a case study in what not to do," Cooke said. Consumer Reports and the U.S. government criticised Samsung's first moves, including a statement that warned of a "battery cell issue" with the phones but did not say they could explode.
Samsung's communication with American customers was also not good, said analyst Carolina Milanesi of Creative Strategies, perhaps because it was coordinating with its headquarters on the other side of the world. "There was an immediate mea culpa, and then it turned into kind of a mess," she said.
While the outside world was clamouring for more information, Samsung's U.S. executives sequestered 40 employees in a crisis triage team at its headquarters in Ridgefield Park, New Jersey, said Tim Baxter, Samsung North America's chief executive.
"I didn't sleep much for 120 days," he said. "At times, we felt a little bit like we were in a bunker."
There, Samsung's top executives started to unpack all of the complicated processes that go into launching a phone, coordinating by video conference with global headquarters in South Korea.
Engineers took the phones apart to find the problem. Staffers spoke with government regulators about the threats to consumer safety. Lawyers braced themselves for lawsuits from people burned by the devices. Others talked to mobile phone carriers about how to get back phones that had been sold. Samsung had to ask retailers to pull stock from the shelves and ship the phones - which had been banned from all U.S. air travel - back to Samsung.
Everyone worked on winning back the trust of consumers who had seen viral social-media videos of smartphones bursting into flame.
"We basically lived in a war room, a conference room for those 120 days," Baxter said. Often, work days would end at 4 a.m. or 5 a.m., he said, and would sometimes pick back up at 6 a.m. "We learned more about working as a team in that time - almost operating as a startup - than I'd ever experienced," he said.
The first step was to figure out what made the phones explode, said Justin Denison, Samsung North America's senior vice president of mobile product marketing.
"It can take a couple of weeks to actually go pick up the device and put it through its paces," Denison said. Without a computed tomography (CT) scan - the same sort of scan a doctor would use in a medical exam - it's hard to tell if a battery has internal problems. Samsung didn't disclose what caused the fires until January, after an internal investigation in which 700 engineers tested more than 200,000 devices and 30,000 batteries, the company said.
Samsung said the recall cost it $5.3 billion to gather the devices and set up testing facilities. It asked three independent safety auditors - UL, Exponent and TUV Rheinland - to investigate. Ultimately, they found that some factories had crammed batteries in cases that were too small for them, causing them to crimp and malfunction.
To prevent it from happening again, Samsung set up a battery advisory group that included academics from Cambridge University, Stanford University and the University of California, as well as battery consultancy firms.
It also added new testing to find points of failure - to disassemble batteries, ensure against leaks and make a visual inspection of each battery.
On the recall end of things, Samsung was aggressive. It developed software to make the Note 7s unusable, so customers wouldn't try to keep them. It sent messages directly to owners through Verizon and AT&T. "We urge you to stop using your Note 7, upgrade it to another device, and return the Note 7 to us," read one from Verizon.
It even reached Note 7 owners at airports where the Federal Aviation Administration required gate agents to warn passengers that the phone was banned from air travel.
Milanesi said that might have been the most damaging part of the recall because it broadcast Samsung's woes beyond its own customers. "That hit normal people; any Joe Blow going on holiday heard this phone wasn't safe," she said.
To control its message and also reduce the number of angry customers caught at gates, Samsung set up trade-in booths at major airports.
(How did Baxter feel about that? "Luckily, I wasn't traveling much at that time," he said with careful diplomacy.)
But the outreach efforts seem to have helped Samsung hit its ambitious goal of getting every phone back. Baxter said that Samsung has collected 99 percent of Note 7 phones sold in the U.S. and that it gathered 96 percent within three months.
"We're still working on it today, to get that 1 percent," Baxter said. "We've scaled back our resources on it, but we still have people working on that."
Even those who criticize Samsung's initial response give the company credit for confronting its failures.
"In the end, they were painstakingly clear about the fact that this happened and it was their fault," said Ramon Llamas, a researcher at IDC.
Cooke said things specific to Samsung helped it weather controversy better than, for example, the fast-casual restaurant Chipotle, which faced an outbreak of food-borne illness that year.
For one, it's easier to find a different burrito joint than it is to switch over apps, contacts, and photos into a new system.
It also helped that Samsung's rivals didn't capitalise on the crisis. Apple's iPhone 7 and iPhone 7 Plus were not smash hits. Samsung was still the top smartphone seller for all of 2016 and 2017, IDC reported. Google, which launched its Pixel phone shortly after the recall - sold only about 1 million phones by the end of the year, according to IDC.
The Note, Llamas said, accounts for about 10 percent of the company's smartphone sales and is just a drop in the bucket when it comes to the number of other products Samsung makes, including televisions, refrigerators and more. Its most profitable business is actually in smartphone chips, which it sells to Apple for use in its iPhones.
He also said Samsung's phone business benefited because it's part of a huge conglomerate. The larger company's total assets are equal to one-fifth of South Korea's gross domestic product. That size cushioned the hit to the brand's reputation.
"I could still turn on my Samsung TV with no problems," he said. Samsung's woes were largely disassociated from the huge number of televisions, dishwashers, microwaves and computer monitors that also bear its name. (In January 2018, Samsung said it expects it will have 1 billion connected devices in the marketplace by 2020.)
Samsung may have also helped itself by aggressively pushing its next product, Milanesi said.
"One reaction could have been to rein it in," she said, referring to Samsung's pace of product releases. But, she said, that's not what the audience for the Note - a tech-savvy niche of consumers - would have wanted.
"Our Note owners are clearly our most loyal users," Baxter said. Communicating with them was a top priority, he said, and Samsung used the email addresses it collected from phone registrations to offer consumers the chance to get direct updates from the company. Baxter said 10,000 people ultimately signed up to receive updates on a bimonthly basis.
The openness may have been the tipping point.
"Samsung was justifiably criticised for being slow with a clear procedure for how and when the faulty phones would be replaced. But it also did something remarkable: They found a way to replace the phones quickly," said crisis communications expert Eric Rose of the Los Angeles public relations firm Englander Knabe & Allen.
Consumers also have short memories. Brand index firm YouGov, which asks consumers how much they trust and respect companies, found in October that Samsung's reputation score was even with Apple's. Samsung has beaten Apple to market with a full-screen smartphone, the Galaxy S8, and has set the design language for a new generation of phones.
"At the end of the day, this is solid proof that good products will overcome some faults along the way," Cooke said. "The case study will be their failure, but it has a happy ending."