A U.S. Coast Guard crew in Maine had a close encounter with a massive shark this week, while returning from a search and rescue mission off the coast of Boothbay Harbor.

"While returning from a search and rescue case offshore, the crew of the 47' MLB encountered a shark crossing its bow,"  the U.S. Coast Guard station in Boothbay Harbor posted on Facebook.

>> Read more trending news

Chief Adam Smith said the crew encountered the shark about 9 miles off the coast of Boothbay Harbor, near Damariscove Island.

"The shark stayed around for a few minutes because the crew slowed the boat down. We didn't want to hit it," Smart told the Portland Press Herald.

The crew was unable to measure the shark, but estimated it to be 20 feet long, compared to the length of the boat, which was 47 feet long.

"Everyone on the crew was pretty excited. It is common to see whales but the shark sightings are rare for our guys," Smart told WCSH.

Marine experts have identified it as a basking shark, which does not pose a threat to humans.

Basking sharks can grow up to 32 feet in length and are known for their unique heads, which are "nearly encircled with enormous gill slits," according to the National Oceanic and Atmospheric Administration.