The lingering stench from putrefying deer carcasses is so powerful in Richie King’s pickup truck that his neighbours once reported him to the police. The suspicious plastic boxes behind our seats are empty today, he promises, chuckling, as we drive into California’s Sierra Azul mountains.

But we are both hoping the smell of fermenting roadkill proves irresistible for an elusive predator in these hills: mountain lions.

King, a wildlife biologist, spends his days setting camera traps at bait sites for the big cats. If they feed on the deer or he finds a kill site, he returns with a cage and collars the mountain lion so it can be tracked by the the Santa Cruz Puma Project, overseen by Prof Chris Wilmers at UC Santa Cruz. Data from this area, surrounded by Silicon Valley, farmland and the Pacific Ocean, is vital to understanding the threats to the species in the region.

The Toyota Tacoma grumbles its way through the Californian oaks as we travel to the first bait site. But in a clearing, King suddenly stops and inspects the road. A line of mountain lion paw prints cover the sandy track in the direction of the camera traps. We continue driving, the pickup roaring as we heave over fallen trees. Then, high in the mountain, a dead deer lying on its side and tied to an oak emerges in the shade. Aside from the flies, humming as they feast somewhere inside the animal, nothing else is about.

Wildlife biologist Richie King checks a camera trap and, bottom left, mountain lion paw prints. Photographs: Patrick Greenfield/The Guardian

“We use the mountain lion’s natural ecology to trigger our trap. The way that works is we play a distressed sound of a rabbit,” Richie explains, unleashing terrified screams from a speaker to make his point.

“If any mountain lion is in the vicinity, they’ll hear this at night time and come to investigate. What he does – what all mountain lions love to do – is grab the deer and drag it off into the bushes,” he adds, detailing how the pulley system tied to the dead animal sends signals to research satellites.

There is a serious point to the Puma Project’s research and the work of their counterparts across the state. Mountain lions, known as pumas, cougars, panthers or brown tigers depending on where you are in the western hemisphere, are fabled, secretive carnivores. Feared, persecuted and hunted in every US state where they are found, apart from California, the animal is rarely dangerous to humans and barely seen. Although, as a community in the Simi Hills were reminded in December when a dog was killed, mountain lions do prey on pets.

A remote camera captures a mother known to researchers as P-13 and her 10-month-old kittens feeding in Malibu Creek State Park. Photograph: National Park Service

“Let’s see here,” says Richie, flicking through the camera trap footage on his laptop. A grey fox. Us. No mountain lion this time. On to the next site.

A 2018 study found that there are 10 genetically distinct subpopulations of mountain lions in the state, with low genetic diversity in areas with high urbanisation and human development. Nowhere is that more apparent than the Los Angeles area.

P-22 is a celebrity but he’s not a success story. He’s a poster child for what’s going wrong here with mountain lions Beth Pratt, National Wildlife Federation

Last year, a study on the genetic diversity of mountain lions in the Santa Monica and Santa Ana mountains concluded that the species is at risk of local extinction in 50 years unless measures are taken to improve genetic diversity. LA’s road network has created genetic islands of mountain lions, driving rampant inbreeding in the big cats. The busy freeways act as barriers and mountain lions are frequently killed by cars on less busy roads. Researchers also fear the road network drives increased violence between males fighting over territory.

But all is not lost. There are plans for a 200ft Liberty Canyon wildlife crossing to span the 10-lane 101 freeway out of the city, used by almost 400,000 cars every day. The $85m (£65m) crossing will be the largest in the world when completed, according to conservationists. So far $13.7m has been raised for the project, largely thanks to the celebrity of one cat: Puma-22, AKA P-22 or “the Brad Pitt of mountain lions”.

“P-22 is a celebrity but he’s not a success story. He’s also a poster child for what’s going wrong here with mountain lions and in some respects all wildlife,” says Beth Pratt, the California director for the National Wildlife Federation and leader of the #SaveLAsCougars campaign. We are sitting on a bench in Griffith Park admiring LA beneath us, Pratt clutching a lifesize cutout of P-22 as we chat.

While famous for the observatory and the Hollywood movie studios that surround it, Griffith Park is also the smallest mountain lion territory ever recorded. Mumbai aside, LA is the only major global city that lives alongside big cats.

“LA is known for its infamous freeways. One of the things that’s happening with P-22 and his relatives is they are likely going to go extinct in the Santa Monica mountains and LA area, especially the population south of the 101 freeway. The reason they’re going to go extinct is that they cannot get across these roadways to find mates outside their family so their genetic diversity is collapsing. These guys need to be able to move freely across this landscape,” Pratt says, explaining the importance of the Liberty Canyon project.

Play Video 0:26

Were he not a mountain lion, the story of how P-22 became famous in LA would be a cliche. A difficult journey to Hollywood, a sudden rise to stardom and then international fame. The people of LA hear these tales every day. But never about a top carnivore.

The image of the mountain lion striding purposefully through Griffith Park in the dead of night, the Hollywood sign beaming in the background, is among the most powerful wildlife photos ever taken. P-22 is still there seven years after his march through the darkness was recorded, feasting on the park’s mule deer, coyotes and racoons.

“Once they found out they had a top predator in their big park, that changed everything,” says photographer Steve Winter, recalling the frenzied reaction to his photo of P-22. He spent months trying to get the perfect shot of the mountain lion under the sign for National Geographic. “It brought people a little bit closer to the natural world which they didn’t feel like they were because you’re in the greater LA area.”

Photographer Steve Winter spent months trying to capture this shot of P-22 for National Geographic

Aside from the suspicious mauling of a koala at LA Zoo and an incident in 2015 when he startled maintenance workers checking under a porch near his territory, P-22 has barely been seen in the seven years he has lived in Griffith Park. But that has not stopped him becoming a celebrity. P-22 has made front page news, and even has his own day, 22 October, dedicated to him by decree of LA City council. Not since the Incas built their capital Cusco in the shape of a puma has the animal been so revered.

But he is trapped by urbanisation and development, unlikely to reproduce unless he manages to negotiate two major freeways and survive the relentless LA traffic.

Much that is known about the mountain lion populations in Santa Monica is thanks to the work of researchers Seth Riley and Jeff Sikich, who have been capturing and tagging the cats since the early 2000s. Both men helped Winter get the famous photograph of P-22. Riley, a wildlife ecologist with the National Park Service, processes the data on lions that biologist Jeff Sikich tracks and captures. Both men know the many of mountain lions they’ve caught inside out, including the problem with inbreeding, which began with P-22’s father, P-1.

By telling P-22’s story, we can inject a lot of the conservation messages we want to get out to the public Jeff Sikich, researcher

Riley explains: “P-1 was the first male we followed and P-2 the first female. They mated and had a litter of kittens, P-5, P-6, P-7 and P-8. Three out of four of them were killed by other mountain lions, two of them by their father P-1. We think those conflicts are exacerbated by freeways … but anyway, P6, one of the females from that litter, mated with P-1 and had P-13. So, P-13 was the result of a father and daughter mating.”

It gets worse and is even a story told by the Top Trump cards created by the Cougars of LA, which were sold to help fund the Liberty Canyon wildlife crossing. The card for P-12, who replaced alpha male P-1 as king of the mountains, tells a grim tale in the “cougar fact” section. It reads: “P-12 brought new genes, but his mating options remain limited. He mated with one of his daughters (twice) and granddaughters (twice).”

If P-22’s fame helps Liberty Canyon wildlife pass get built, then the future for the area’s mountain lions could change for the better. Sikich, who still regularly catches the most famous mountain lion in Hollywood to check on his health, understands his symbolic importance.

“By telling P-22’s story, we can inject a lot of the conservation messages we want to get out to the public. Being trapped in this little park, we can talk about habitat fragmentation and the need for corridors.

One of a litter of four mountain lion kittens found in the Simi Hills by researchers in 2018.

“We can use this one individual to tell this bigger story to help conserve this species in this area and in other areas,” he adds.

Back in Santa Cruz, King and I are heading to the third and final stop of the day: a kill site he located using tracking data of a mountain lion, 25-F, on the outskirts of Santa Cruz, not far from the beach. We hike up to the unfortunate fawn halfway up the mountain and check the final camera.

“Here she is,” King smiles, holding up the video of the mountain lion dragging its kill away. Victorious, we head back to the car.

Find more age of extinction coverage here, and follow biodiversity reporters Phoebe Weston and Patrick Greenfield on Twitter for all the latest news and features