When a young California gray whale made a pitstop in a southern California harbor Tuesday morning, crowds of people gathered to watch the young mammal as it swam with and entertained beach goers.

The whale was first spotted swimming into Dana Point Harbor in the early morning by a paddle boarder and did not leave until the midafternoon. Local wildlife photographer Mark Girardeau captured aerial video of the whale where it can be seen swimming close to the shore only a few feet from dry sand.

Posting about the incident on its Facebook page, one whale-watching group involved in monitoring the whale's habits noted it looked remarkably skinny. In an interview with a local NBC affiliate, Justin Greenman, assistant stranding coordinator for the National Oceanic and Atmospheric Administration (NOAA), commented that the roughly 20-foot whale had barnacles and sea lice clinging to its body, meaning its health was potentially compromised.

Many who commented on images of the whale swimming in shallow waters feared that the animal would beach as it came close to dry land. That it was spotted in water only several feet deep gave many people cause for alarm.

So why was the whale seemingly lost? It was probably a loner.

Bruce Mate is the director of the Marine Mammal Institue at Oregon State University. He doesn't think it's unusual that the whale was found adrift from a group of gray whales, in fact he thinks it's very common. During gray whales' summer feeding season, they're sometimes spotted in groups, but ultimately they forage alone.

"There might be a bunch in the same place," said Mate, "but they're out there making a living for themselves."

As to why the animal was so close to shore? That's pretty common, too.

"We see animals in shallow water daily," said Mate of the gray whales he witnesses in Oregon. Gray whales are frequently seen feeding on the sea floor, eating amphipods and other small crustaceans, but Mate stressed the animals will feed on whatever food is available to them.

"They're more opportunistic than people give them credit for," said Mate.

Mate has spent the past 40 years studying gray whales. He conceded that it is unusual to see them in southern California in the middle of August. By this time of year, migration has typically ended for gray whales, and the majority are in feeding grounds in Oregon or by Alaska near the Arctic.

He wasn't surprised that the whale appeared skinny, and its weight doesn't necessarily indicate poor health. In the Fall, when whales migrate south to Mexico, they fast and are skinnier in the Spring as they migrate north. When looking for a potentially sick or starving whale, Mate and his colleagues look for protruding vertebrae or scapula that can be seen through the whale's skin. Many of the tagged blue and gray whales the Marine Mammal Institute monitors have been skinner than normal in the past four years. Mate attributes this to stronger El Niños and the dangerous Pacific "blob" causing a growing number of marine animal deaths on the West Coast. (Read more about the blob cooking the Pacific.)

Migrating Whales

Gray whales are frequently spotted in the area during their migration from Baja, Mexico, to Alaska. During winter months, gray whales move to the warmer waters off the coast of Mexico to give birth. By around February they migrate 12,000 miles north to feed in colder waters off Alaska. Gray whales undergo some of the longest migrations on Earth. One female gray whale completed the longest migration route ever documented when it swam from Russia to Baja, over 14,000 miles, in 2015.

According to a local California whale-watching group, migratory gray whales are usually only spotted as late as May. A juvenile gray whale was spotted on Monday near Tamarack Beach, roughly 30 miles south of Dana Point Harbor, and it's believed to be the same whale.

And while the whale does appear to be a juvenile, it's not quite a calf. Gray whales typically spend the first year of their lives with their mothers, but this whale appears to be two or three years old. At this teenage, juvenile phase of its life, a gray whale will have weened and separated from its mother, but it won't be ready to mate until about five years old. (Learn more about gray whale mating habits.)

Watch: Killer Whales Charge Blue Whale (Rare Drone Footage)

In an interview with the San Diego Union-Tribune, one local scientist commented that it wasn't unusual to spot whales taking a break to rest during their long journey north, and one NOAA official remarked that it may have been left behind in Mexico.

Mate stressed that gray whales are intelligent creatures that often travel alone, and many have distinct personalities. And this species, particularly juveniles, are exceptionally curious.

Happy Ending

To finally coax the whale out of the harbor, the Orange County sheriff's department used hoses attached to fire boats to create loud splashes in the water. Nearby paddle boarders and kayakers also slapped the water in an attempt to guide the whale into open waters.

Marine mammals such as gray whales rely heavily on hearing to navigate. Daytime boat traffic can be disorienting, so officials used noise in an attempt to reroute the animal.

Speaking with the Orange County Register, Greenman of NOAA said harbors near Newport Beach and Los Angeles have been alerted about the whale's presence. Kayakers and paddle boarders are asked to take caution.