Just a few decades ago, the California sea lion seemed on the verge of becoming an endangered species. It was 1964, and hunting and fishing had caused the breeding population off the West Coast to shrink to just 35,000.

How times have changed. After the Marine Mammal Protection Act of 1972 made it illegal to kill or harass sea lions, their ranks steadily grew — and grew, and grew. Now, according to recent estimates by the National Marine Fisheries Service, California sea lions number in the hundreds of thousands, making them comfortably within the range of what experts call the “optimal sustainable population.”

It’s as good a success story as a species can hope for. But there’s a hitch: A robust population of barking sea lions is not particularly easy for people to live with.

“The reality is that the people who wrote the Marine Mammal Protection Act could never have imagined the situation we have now,” said Sharon Melin, a wildlife biologist with the service and a co-author of the new sea lion status report. “Suddenly, they’re now in the system, and they’re competing with people for the same resources.”

Those resources include fish, but also seaside recreational areas. In December, a popular San Francisco swimming cove temporarily closed after three incidents involving sea lions that took a bite out of swimmers. The cove reopened in late December, and by early January, a fourth swimmer had been sent to the emergency room with a heavily bleeding bite.

Last May, a crowd of tourists oohed and awed as a sea lion swam near Steveston Fisherman’s Wharf near Vancouver, British Columbia — until the animal lurched, snagged a little girl by the hem of her flower-print dress and pulled her into the water. The incident prompted port officials to renew warnings against approaching the marine mammals, which can weigh upward of 800 pounds and measure seven feet in length. But the same dock was crowded with around 100 onlookers two days later.

Perhaps no place typifies dysfunctional human-sea lion coexistence like the San Diego community of La Jolla. Several years ago, the city erected a fence to keep people off the coastal bluffs where a growing population of sea lions and an entourage of sea birds congregated. Soon a buildup of marine mammal and avian excrement started to waft through the neighborhood. One group of residents, known as the Citizens for Odor Nuisance Abatement, sued the city, arguing that the fence allowed sea lions and their stink to prosper, negatively affecting tourism and property values. The lawsuit said that champion boxer Floyd Mayweather — who has been knocked down just once in his career — checked out of a nearby hotel 15 minutes after he arrived due to the smell. Score a KO for the sea lions.

A court disagreed, saying the fence could not be blamed for the growth in local sea lions and their stench. The city installed a gate in 2014, which gave people access to the bluffs and helped deter sea lions from congregating — temporarily, anyway. Then the animals started hauling up on shore in similar numbers as before. Soon people were snapping selfies with sea lions, prompting the National Oceanic and Atmospheric Administration to erect signs reminding visitors that getting too close to these animals is not only illegal, but that it can cause them stress.

Conflicts like these aren’t easy to solve, and Melin suggested that’s not likely to change soon. “Those sorts of issues … are going to continue to plague us, partially because sea lions are a coastal species, and they really are pretty adaptable to humans,” she said.

The good news, Melin said, is that the same things that make sea lions troublesome neighbors — their shoreside loafing, for example — make them excellent research subjects.

“Most marine mammals are incredibly difficult to study. They’re underwater something like 90 percent of the time,” Melin said.

Sea lions, on the other hand, come ashore to rest and pup, and they do so in fairly accessible areas. Their presence has allowed scientists to take stock of the population and measure its response to environmental changes. And what they’re seeing suggests the sea lion boomtime might not last.

For instance, sea current shifts and warmer surface waters during El Niño years often drive prey fish away from the California coast. When that happens, sea lions must swim farther and dive deeper to fill their bellies, a trend that can be measured in the declining number of pups born in such years, as well as in lower survival rates among those that are born. El Niños also tend to bring toxic algal blooms. Mussels eat the algae and absorb tiny bits of poison, which then works its way up the food chain and into mussel-eating sea lions, sometimes causing dementia, seizures and paralysis.

Because of all this, Melin and her co-authors project that sea lion growth could grind to a halt if global warming causes sea surface temperatures to rise just one degree Celsius, they wrote; at two degrees, the population will begin to decline by 7 percent a year. This means it wouldn’t take much to push the species back to the edge.

“We saw that with the Steller sea lion,” Melin said of a northern Pacific species that has experienced a rapid, and not fully understood, decline. “It only took five years for it to go from what everyone thought was a good healthy sea lion population to one that’s now listed as endangered. That’s why you can never take your eye off the ball.”

For what it’s worth, keeping sea lions around isn’t just good for sea lions. It could also be good for us.

The animals can fall victim to a nasty, sexually transmitted cancer that is associated with a herpes virus. Scientists think that studying this disease, which can melt a sea lion’s spinal column, may yield valuable insights into human cancers that are also associated with viruses.

“A lot of people that do research in cancer use lab animal models, and they control all the parameters as much as they can,” said Alissa Deming, a virologist who is the Geoffrey C. Hughes research fellow at the Marine Mammal Center in Sausalito, Calif., where researchers study cancer in stranded sea lions. “It’s not really reflective of how cancer develops in real life.”

Sea lions, on the other hand, are out in the real world looking for food, being exposed to pollutants, getting stressed out by predators, and just doing their thing — yes, often on beaches people consider theirs.

Read more: