SAN DIEGO — Two people were on a sailboat, seemingly riding out Tropical Storm Hilary on San Diego Bay, when they were pushed up against the rocks and needed to be rescued, according to San Diego Harbor Police.

Police said they got several 911 calls for a vessel in distress and responded to the boat by both land and sea.

When they arrived, the boat was getting repeatedly slammed against the rocks, so they had to tow the boat out to sea a little farther in order to rescue the two people and two dogs on board.

“It was a pretty violent situation. The boat was being crushed or pounded against the rocks due to the wind and the waves,” Lt. Shawn Wooddy said to FOX 5. He was the incident commander during the response Sunday night.

He said as soon as the two people were rescued from the boat, they had medics waiting on land to evaluate them. No one was injured in the rescue.

Video shows the sailboat battle waves waves and rock through wind gusts that reached up to 39 mph.

The U.S. Coast Guard was heard on radio and was on standby to assist in the rescue.

According to the Coast Guard, a few hours prior to this incident, the same boat’s anchor broke in the middle of the water around 7:30 p.m., and they contacted the Coast Guard for a tow.

The Coast Guard then towed them to Harbor Island Park.

Lt. Wooddy said when inclement weather is on the way, it’s important for mariners to be prepared.

“We have a lot of people who do elect to live aboard their vessels,” Lt. Wooddy added. “You have to be prepared, understand what you need as proper equipment, as far as anchors, everyone thinks, ‘oh, every boat should have an anchor,’ which is true, but boats should have extra anchors as well.”

Wooddy said harbor police opened up the bay as a “safe harbor,” which is indicated by lights and flags. He said this alerted mariners going by they could seek protection in the bay for safety during the storm.

He said since the bay is naturally formed, it provides a great barrier for protection. He said several mariners took the offer and were in the bay as the tropical storm passed over the region.