Photo: Alex Washburn/WIRED The first steps include removing much of the whale's blubber. (Photo: Nadia Drake/WIRED) Slicing into the blubber. Below, onlookers watch the necropsy while a sea gull sneaks in for a bite of discarded flesh.

(Photos: Nadia Drake/WIRED) The team used large hooks to separate the blubber from the whale, a process that involved some intense physical activity. (Photo: Nadia Drake/WIRED) Collecting fluid from the stomach. (Photo: Nadia Drake/WIRED) The team gets ready to bag bits of kidney. (Photo: Nadia Drake/WIRED) Collecting part of the kidney, which looks like a pebbled structure. (Photo: Nadia Drake/WIRED) At one point, the excavator nearly tipped over while trying to drag the whale farther up the beach. Rolling the carcass worked much better. (Photo: Nadia Drake/WIRED) Scientists collected both eyes from the whale. Here's the right one. Below, a seagull stands near the spot where the whale's left eye used to be.

(Photos: Nadia Drake/WIRED) Yes, you could fit inside a whale's mouth. (Photo: Nadia Drake/WIRED) Scientists get ready to roll the whale toward its grave. After rolling the whale, scientists needed the excavator's help teasing the intestines from the carcass. (Photo: Nadia Drake/WIRED) After rolling it up the beach, and before burying the whale, researchers climbed into the animal's thorax, looking for any clues they might have missed. (Photo: Nadia Drake/WIRED) The whale is pushed into its sandy grave. (Photo: Nadia Drake/WIRED)

Twelve hours after it was first reported stranded alive on a beach just north of San Francisco, a 42-foot-long fin whale tumbled into its oceanside grave – a large and sandy pit, quickly excavated near the back of the beach.

This is only the fourth fin whale to wash ashore in this area since 2010. But what's really unusual is that the animal was still alive when it reached the beach, giving the scientists – who arrived just after it stopped breathing – the extremely rare opportunity to perform an necropsy on a fresh whale carcass.

Veterinarian Shawn Johnson, in the green cap, pauses during the necropsy (Nadia Drake/WIRED).

"These large whales, by the time they wash up, they're already severely debilitated," said Shawn Johnson, director of veterinary science at The Marine Mammal Center. Most often, large whales washing ashore have been dead for a while, and can be too decomposed to learn much from."This is our first live whale," he said.

Sleek, fast, and mysterious, fin whales are an endangered species second in size only to the blue whale. Not much is known about their social structure or mating patterns. Because they prefer deeper waters, these whales are rarely seen except when they strand on beaches. What little we know about their vocalizations comes mainly from data gathered accidentally by seismometers on the seafloor off Washington state.

This particular fin whale’s last hours began early yesterday morning, when it stranded on Stinson Beach sometime after midnight. Shortly after 7 a.m., the stranding was reported to The Marine Mammal Center, located about an hour away. For several more hours, the whale wriggled in the sand, breathing about once per minute, with his nose in the sea and his tail fanned toward the shore, before finally dying.

As the tide began receding, teams from The Marine Mammal Center and the California Academy of Sciences assembled for the unusual autopsy, which is known as a necropsy when it's performed on an animal. The procedure, which is ominously accompanied by the continual hum of knives being sharpened, involves inspecting the entire animal, inside and out. By the end, scientists would know more about an animal and why it died.

If you've never witnessed a whale necropsy, here's how it works.

The team began by measuring the whale and looking for any signs of bruising or trauma. Some were already visible: The whale had blood near its mouth, and scrapes along its body.

Chunks of blubber wait for transport up the beach (Nadia Drake/WIRED).

Then they started moving inward. Layers of skin and blubber, peeled off in rectangular chunks, tiled the beaches until hauled away on tarps (much to the glee of hovering seagulls). Beneath those chunks lay a thick layer of muscle. Scientists broke through it with effort, dug through the mass of muscle and fat, and retrieved the organs inside. They took chunks from the organs and preserved several dozen samples for lab analysis. They also collected blood, urine, and three large tubes of the stinky brown fluid oozing from the stomach.

“It’s in really great body condition, the organs look good," Johnson said. “It’s got all this abdominal fat."

Though the stomach contents revealed that the whale was eating solid food and no longer nursing, the animal's length and the amount of fat spilling out by the bucketful during the exam suggest it may not have been on its own for long. At 42 feet, 9 inches long, the whale is still small relative to adult fin whales, which can grow to nearly 90 feet in length.

As the roughly two dozen team members raced the incoming tide, discarded flesh landed with a plop and blood pooled in the sand, staining the ocean red.

By 6 p.m., scientists had rolled the whale over and extracted intestines as thick as your arm, eyeballs bigger than grapefruit, and baleen that refused to budge until snapped with a branch cutter. Along with the color of the whale's lower jaw, the baleen’s distinct coloring – which is white in the front and black in the back – confirmed that this was, indeed, a fin whale. The team also extracted bits of the whale’s kidneys and liver, and studied its heart, which is the size of a small child.

The heart and part of the whale’s underside showed signs of hemorrhaging, a possible sign of traumatic injury. A bloody area, about the size of a large trash can lid, covered the whale's sternum. And, the tissue in the area was filled with air bubbles, known medically as subcutaneous emphysema, another sign of trauma.

“I don’t think there’s any way those bubbles would be there if it hadn’t been hit,” Johnson said.

These findings are all consistent with the whale colliding with something, perhaps with a relatively small ship. The behemoth container ships that have been known to smash into whales often leave the mammals with massive fractures, dead long before they reach the shore. This whale had no broken bones – just a large, bloody patch beneath its skin. And it was alive when it arrived.

“We’ll get the microscopic exams back and verify we didn’t miss anything,” Johnson said.

Lab tests will tell the team whether there's any unusual that they couldn't see during the necropsy – things like tissue or cellular abnormalities, an unusual parasite, or bacterial or viral infection.

Around 7 p.m., the whale, at this point beginning to ripen, was pushed into its sandy grave by an excavator, a burly machine that struggled mightily with the whale’s many tons of weight.

As darkness crept in with the fog, the beach emptied and the backhoe continued piling sand atop the buried carcass.