The death sentence that hung over P-45, a young Los Angeles mountain lion with a taste for alpaca, has been commuted.

The big cat made national news last month after he was named as the prime suspect in a killing rampage that left 11 alpacas and a goat dead in the hills of Malibu, Calif. The owner of most of the slain animals, rancher Victoria Vaughn-Perling, was issued a state permit to have P-45 — whose radio collar placed him in the vicinity of the bloodbath — shot and killed. That triggered an outcry from mountain lion fans, animal welfare activists and wildlife conservationists, who view a breeding-age male such as P-45 as crucial to the survival of the small population of cougars that roams the Santa Monica Mountains.

To their relief, Vaughn-Perling’s permit expired Thursday, several days after she announced that she did not want P-45 to die. And on Friday, she worked with volunteers from the Mountain Lion Foundation and other organizations to build what the Los Angeles Daily News described as four 10-foot-by-10-foot chain-link “lion-resistant enclosures” for her 15 surviving alpacas. The pens were paid for by the National Wildlife Federation, according to the Associated Press.

The drama over P-45’s latest alpaca slaughter — he has been implicated in several past attacks on livestock — renewed attention on the plight of the dozen or so mountain lions that inhabit the dry hills of one of the nation’s most populous places, as well as to the challenge local humans face in protecting domestic animals from the wild feline predators. The big cats are penned in by freeways, preventing their migration for breeding, and they sometimes ingest poisons intended for rats and other pests. And while they mostly feed on deer, they have also been known to feast on pets and livestock.

Amid the uproar over Vaughn-Perling’s “predation permit,” the National Park Service, which tracks P-45 and other mountain lions in Santa Monica, argued that his attack on the alpacas was simply instinct in action — and no reason for him to die. Vaughn-Perling, who told local reporters that she raises alpacas for their fleece but also considers them pets, then said she wanted the cougar trapped and moved to a sanctuary. But that idea could have harmed P-45, wildlife advocates said, and it certainly would not have helped the local mountain lion population flourish.

Vaughn-Perling’s new alpaca pens represent what wildlife conservation groups say is the best solution for all animals — structures that protect the domestic ones from the wild ones that live in their midst. Vaughn-Perling told the Daily News she was “grateful and delighted” for the help.

P-45 might not be so delighted that alpaca meals are harder to come by. But for now, he’s free to continue seeking prey in the wild, as he has always done.

Read more: