It’s been almost a century since doctors began using antibiotics to treat bacterial infections and illnesses, and those treatments have saved many, many lives in the decades since. Antibiotics are great, but one of the biggest fears of medical experts and researchers has been the emergence of so-called “superbugs,” or antibiotic-resistant bacteria that mutate to defend against common drugs.

Now, a new medical report published in Antimicrobial Agents and Chemotherapy explains how one strain of bacteria managed to beat an antibiotic that is considered “a last resort treatment” against multidrug-resistant bacteria. The scariest part? The bacteria evolved its resistance in just weeks.

As the report explains, the patient presented with an infection of a multidrug-resistant Pseudomonas aeruginosa after a surgical operation. The situation was dire, so doctors decided on treatment with Ceftolozane-tazobactam, a combination antibiotic that has been considered a safety net for patients with antibiotic-resistant bacterial infections since its introduction in 2014.

The patient’s condition appeared to be improving, with the drug doing its job of killing off the bacteria. Then, just over three weeks into treatment, doctors realized something was amiss. A new strain of the bacteria that was immune to the new drug appeared in the patient, allowing the infection to persist.

This was an unexpected development and a mutation that had never been seen before in a patient. Scientists had observed such mutations in laboratory settings, but this is the first time it was seen in a real-world case, and the fact that it happened so rapidly was indeed a shock.

However, like a goalie moving to block a shot at one side of the net, the mutation that allowed the bacteria to survive the antibiotic onslaught created new vulnerabilities that the doctors exploited. Doctors treated the patient for a further two and a half years, using drugs that had previously been ineffective but were now able to pierce the bacteria’s defenses.

Eventually, the patient was able to beat the infection. The case, while scary in the sense that the bacteria made such a rapid change to beat the last-resort treatment, offers a glimmer of hope for beating superbugs that may leave themselves vulnerable when mutating to meet new antibiotic threats.