LUBEC, Maine — A basking shark stranded Wednesday in Lubec was a healthy male that made the mistake of swimming into shallow water as the tide was going out.

The 24-foot basking shark was first spotted beached during low tide about 5 or 5:30 a.m. Wednesday in the Lubec Narrows. People gathered around it and began pouring seawater over its gills in a failed attempt to save its life.

“We didn’t find anything that suggests that the animal didn’t just die from being out of the water,” said Dr. Andrew Westgate, a shark biologist among those who performed a necropsy on the animal Thursday morning. “I think the tide just went out quickly and the shark got caught.”

The people who poured seawater over its gills probably did help to keep it alive for awhile but, in the end, the shark was just out of the water too long, Westgate said Friday.

“[The shark] just made the error of getting into too shallow water,” he said. “They don’t have very large brains.”

Westgate, who is affiliated with the University of North Carolina at Wilmington, which has a summer research site on Grand Manan island, said he has been coming to do research in the area since 1989.

“I’ve never seen a stranded basking shark,” he said.

Westgate said the shark probably entered the channel during the night when it was dark and then, as the tide went out, was unable to turn around and swim out.

Although saddened that the shark died, Westgate said it gave researchers a rare opportunity for study.

His group at Grand Manan is studying shark muscles. Usually this involves collecting 2-inch biopsies with a pole.

“We were actually able to take a cross section of the entire body,” he said. “Our understanding of the animal definitely improved.”

After the necropsy was completed, the crew towed the body out to sea where it can decompose naturally.

Westgate said the body will provide a “nice feast” for lobsters and other sea creatures.

The basking shark is the second largest fish in the world, reaching lengths of 35 feet. The largest is the whale shark, which can be up to 50 feet long. Whales are bigger than sharks, but they are mammals, not fish, Westgate said.