The 4-year-old boy in critical condition was unconscious and not breathing when he was taken from the water, said Fire Department Assistant Chief Bob Postel.
PHOTOS: Dozens rescued after boat capsizes off San Francisco
A good Samaritan performed CPR on him until a police officer took over, said San Francisco Police Officer Giselle Talkoff.
Photographs posted on social media showed youths and adults barefoot and wrapped in thick gray blankets on shore after being rescued. The boat, which was carrying 30 people, became fully submerged in the water.
Fisherman David Griffiths told the San Francisco Chronicle he tossed life jackets to the people in the water. He was taking off his shoes and getting ready to jump in when the first rescue teams arrived, Griffiths said.
A boat capsized in SF sending 5 adults and 3 children to a hospital. (video by Nannette Matthews) https://t.co/p5w9k9cWej pic.twitter.com/IfarfCvBk2
— ABC7 News (@abc7newsbayarea) October 9, 2016
Postel said rescue teams from the fire and police departments and the U.S. Coast Guard all rushed to the scene.
"There were lots of rescue boats on the water because of Fleet Week, so we were fortunate," he said. "We were able to get everybody out and accounted for quickly."
Griffiths said it was jarring to see the boat upend during what had been an otherwise beautiful day on the water.
"Seeing the bottom of it, that's not a normal thing," he said.
Authorities are investigating the cause of the accident.
This is the staging area for people getting treated after a boat capsized in SF Bay during #FleetWeek festivities. pic.twitter.com/nSSRrmhfcD
— Sergio Quintana (@svqjournalist) October 9, 2016
#SF firefighters are on the scene near #Pier45 after a boat carrying about 30 juveniles capsized. https://t.co/p8ywDUORDo pic.twitter.com/gJoVBbKg4Z
— ABC7 News (@abc7newsbayarea) October 9, 2016
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
Capsized boat in #SF bay. Rescue efforts underway pic.twitter.com/RDeug5JxCp
— Lisa Amin Gulezian (@LisaAminABC7) October 9, 2016
#sffd first responders at Hyde Street Pier #pleasebesafe pic.twitter.com/6wpxxtj0rU
— Edzep11 (@edzep11) October 8, 2016