The carcass of what is believed to be an extremely rare whale seen only in the deep ocean washed ashore at San Francisco's Ocean Beach on Monday.

The 47-foot-long cetacean was so decomposed and gnawed on by sharks that marine biologists could not figure out whether it was an endangered fin or sei whale or some kind of hybrid, but all three are extraordinarily rare in these parts.

"Most likely it is a fin whale," said Jan Roletto, the research coordinator for the Gulf of the Farallones National Marine Sanctuary. "But it has characteristics that are not like fin or sei whales. It could also be a hybrid, but that would be way out in left field."

Roletto said there is no way to determine how the whale died, but it had a slash mark on the tail area, indicating it had been hit by a ship either before or after death. Authorities plan to bury the whale in the sand at Ocean Beach.

Fin and sei whale populations were decimated by 18th and 19th century whaling, and both are listed as endangered species. A 2009 federal report estimates between 2,300 and 2,600 fin whales exist off California, Oregon and Washington.

Sei whales are even rarer, with fewer than 50 in the ocean off of the three states. That's compared with as many as 45,000 of each species before whaling.

The two whale species are almost never seen near shore. A half dozen fin whales have been seen near the Farallon Islands this year, supporting speculation that the dead whale might be a fin.

"That's more than what we've ever seen before," Roletto said.

Hybrids from fin and blue whale dalliances have been seen before, Roletto said, but cross-species romances like that are very rare. Blubber and skin samples have been collected for DNA testing, the results of which are expected in a few weeks, she said.

The cut on the whale body initially led authorities to believe that it was the same whale towed out to sea last week after it was found on the bow of the ship, Durgerian said.

That whale was hit Thursday by a container ship heading from Los Angeles to the Port of Oakland. Marine biologists think it was alive when it was struck at sea.

When the ship, the 642-foot Northern Vitality, arrived in Oakland, the mammal's head was missing and sharks had been feeding on the carcass. It was believed to have been a minke whale.