Every passenger is accounted for after a boat carrying 30 people capsized near San Francisco's Pier 45 Saturday afternoon, according to public safety officials.

A total of eight people, ranging from five adults to three children, were transported to local hospitals with varying degrees of injury, but everyone is expected to survive, according to public safety officials.

A 4-year-old child, who was previously listed in serious condition, was pulled from the water and found to be unconscious, but a good Samaritan and public safety crews were able to initiate CPR before sending the child to a local hospital, Giselle Talkoff from the San Francisco Police Department said.

A second child was also listed in critical condition, Bob Postel from the San Francisco Fire Department said. The rest of the transported passengers reported to be suffering from hypothermia-related injuries after floating in the cold water.

Public safety crews and bystanders help rescue 30 passengers after a boat capsized in the San Francisco Bay (Credit: Gary Matthews).

Rescue crews and helpful bystanders spent roughly 30 minutes plucking the boaters from the water after the vessel, which has been identified as 34-foot-long boat named "Khaleesi," began to take on water. Some of those passengers onboard were reportedly trapped underneath the boat's hull, according to witnesses.

PIER 45 BOAT CAPSIZED WITH ABOUT 30 JUV ON BOAT SOME ARE TRAPPED UNDER THE HULL. USCG BOAT/HELIO/DIVERS EN ROUTE. pic.twitter.com/KnEKFVgpjx — San Francisco Fire (@sffdpio) October 8, 2016

Fellow boaters jumped into action and provided any aid they could while rescue crews arrived on scene.

"There was just a ton of people in the water," witness David Griffiths said. "We just started throwing life rings."

Another good Samaritan reportedly dove in the water and freed a father and his child who were both trapped inside the vessel's cabin.

Despite the serious injuries and frantic ordeal, Postel said the capsizing could have resulted in a much worse outcome.

"This could have been really, really catastrophic," he said. "For this to have the outcome that it did, is really a lot of good fortune and good luck."

Postel credits the U.S. Coast Guard, local police and fire agencies, and good Samaritans for assisting in the rescue. Public safety officials also noted that several emergency crews were in close proximity to the boat because of the ongoing San Francisco Fleet Week festivities.

The boat did submerge completely and authorities are conducting an investigation into what caused the vessel to sink.

This is the second time in five weeks that a boat has capsized in the Bay. Back in September, a catamaran took on water and sent all 16 passengers into the water. No one was injured during that accident.

EDITOR'S NOTE: A previous version of this story reported that a 5-year-old child was found to be unconscious after being pulled from the water. That child is 4 years old after clarifications were made.