A new survey of sea life in the Pacific Ocean suggests that some endangered sea turtles are making a comeback. The survey showed that populations of green sea turtles along dozens of coral reefs in waters around Hawaii and other nearby regions either remained stable or increased from 2002 to 2015.

The scientists behind the survey, which was described April 24 in the journal Plos One, called the finding compelling evidence that conservation efforts like hunting bans are working.

“You often hear such bad and challenging news about the threats that our ocean faces,” said Kyle Van Houtan, chief scientist at the Monterey Bay Aquarium in Monterey, California, and leader of the team of researchers that conducted the survey. “There are places where there are a lot of sea turtles very close to shore. And that’s good news.”

Once hunted for their meat, green sea turtles were designated an endangered species in 1978. They're now protected under U.S. law and international treaties.

The same survey suggested that populations of hawksbill turtles, another protected species that is even more endangered, remain perilously low.

The survey effort began almost by accident, according to Van Houtan. On a research expedition to count fish living on reefs, divers with the National Oceanic and Atmospheric Administration found themselves counting turtles, too.

As it turns out, counting turtles in the water is more reliable than counting them on land, where only egg-laying females and their hatchlings are visible. “Really understanding the dynamics of turtle populations requires more attention to different age classes, and that means getting out on the water,” David Godfrey, executive director of the Sea Turtle Conservancy in Gainesville, Florida, told NBC News MACH in an email.

So Van Houtan and his colleagues decided to formalize the count. Over 13 years, divers trained to count green sea turtles and hawksbills visited 53 reefs across the Pacific, including spots in Hawaii, the Marshall Islands and American Samoa. Towed along by a slow-moving boat for a total of more than 4,500 miles, the researchers tallied more than 3,400 turtles.

The research represented a “Herculean effort,” Van Houtan said, adding, “This is the kind of data and the kind of study we’ve wanted for so long.”

Analysis showed that what the scientists call "turtle density" — the estimated number of animals per kilometer based on the survey counts — had increased by as much as 8 percent each year in some areas.

Turtle density increased the most in areas that tended to have few turtles at the start of the census period, including the Hawaiian Islands. The greatest turtle density was seen In the Pacific Remote Island Areas, uninhabited islands west of Hawaii, with an average of 3.62 green turtles per kilometer.

Hawksbill turtles, meanwhile, were outnumbered by green turtles by 11 to 1. “Their numbers have not really come back,” Van Houtan said of the hawksbills.

The highest turtle densities were seen in regions with plenty of seagrass and algae for the turtles to eat; minimal human presence; and, most important, water temperatures at 80 to 82 degrees Fahrenheit. Sea turtles flourish in that "Goldilocks" environment, which is neither too hot nor too cold.

But as the world's climate continues to warm, turtles and other marine species may be forced to relocate. “As the ocean warms with climate change, that ideal temperature is going to move toward the poles and away from the equator,” Van Houtan said. “As the temperatures change, those distributions are going to change.”

While Van Houten is wary of the effects this move will have on the greater coral reef ecosystem, he’s optimistic about the turtles’ odds for survival.

“They’re very resilient animals, and they’ve lived for millions of years,” he said. “The turtles aren’t going to roll over and die.”

Want more stories about animals?

SIGN UP FOR THE MACH NEWSLETTER AND FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.