A San Francisco Fire boat capsized Saturday morning while seven firefighters were doing an exercise drill, thrusting all aboard into the chilly waters.

The 30-foot boat was in the water near the Ocean Beach area when it tipped over. Fire officials said initially that the boat had capsized near Marina Green.

All seven firefighters were rescued, according to Jonathan Baxter, a public information officer with the San Francisco Fire Department. One of the firefighters will stay overnight as a precaution.

"It could have been a lot worse," Baxter said. "They did an extraordinary rescue."

Baxter also said that five of the firefighters flung overboard were rescued by either Coast Guard or other fire officials, while two others were rescued by people boating nearby.

None of the officers appeared to have suffered from serious injuries, fire officials said. There has been speculation among officials that the boat capsized due to a large, rogue wave, although the matter is still under investigation.

"Fortunately our water rescue craft was behind the rescue boat, so we had some people able to get them out pretty quickly," said Mark Gonzales, a deputy chief of operations with the San Francisco Fire Department. He thanked the people boating nearby for their quick and helpful reaction.

A buoy near where the boat tipped measured waves of roughly 7 feet and winds of up to 26 miles per hour, according to the National Weather Service.