It was a close call for a humpback whale in the San Francisco Bay on Saturday.

Video taken from the Golden Gate Bridge by Lauri Duke shows the whale rolling out of the way as the boat approached.

Duke volunteers at the Marine Mammal Center in Sausalito and takes photos to help Golden Gate Cetacean Research identify whales and dolphins. She heard reports of several whales near the south tower of the bridge Saturday morning and went to take photos with her husband.

"The incident with the sailboat happened almost as soon as my husband and I got up to the tower," Duke said. "I noticed a sailboat coming directly at [the whale], and could not believe it was not turning away."

She says the humpback wasn't hard to see; it had spouted twice before it surfaced for a third time and dodged the oncoming sailboat just in time.

"I'm very glad that it wasn't a second or two later," said Duke.

After that, Duke said the whale disappeared and the sailboat continued on (after those on board snapped a few pictures, of course).

A number of reports of encounters with humpbacks have surfaced lately. Last month, a kiteboarder crashed into a humpback whale. A boat was also caught on camera colliding with a whale.

Bill Keener, a marine biologist with Golden Gate Cetacean Research, said he has observed a major influx of whales in the San Francisco Bay in recent weeks, which has tempted some people to get too close.

"It's a wildlife spectacle so it's always attractive to people," Keener said. "My advice is if you see whales concentrated in an area, give them a wide berth. If they're feeding and they come up from the depths to lunge up, you don't know where they're going to come back up."

However, policing these sort of wildlife encounters can be difficult. In some parts of the country, such as Puget Sound in Washington or off the coast of Hawaii, there are strict rules about how close people are allowed to get to orcas and humpbacks (200 yards and 100 yards, respectively). The California coast is regulated by the Marine Mammal Protection Act, which prohibits feeding or harassing marine mammals.

What constitutes harassment can be hard to define, but according to the National Oceanic Atmospheric Administration's website, it means "any act of pursuit, torment, or annoyance that has the potential to injure a marine mammal" or something that causes "disruption of behavioral patterns, including, but not limited to, migration, breathing, nursing, breeding, feeding, or sheltering."

"People getting close to marine animals is not good for the animals and it's against federal law," NOAA spokesperson Jim Milbury said. "But more importantly, or as importantly, people can get hurt."

The penalty for violating the Marine Mammal Protection Act could include a fine of up to $11,000, up to one year in prison and forfeiture of the vessel involved. NOAA's law enforcement branch considers whether the act was intentional, unintentional or negligent when determining the punishment.