The incident was reported at about 6:50 p.m. at the beach near the intersection of Great Highway and Sloat Boulevard, Coast Guard Petty Officer John Eastman said.
The girl was swept out to sea and a Good Samaritan, a woman in her 20s, swam out to try to get her, Eastman said. The Good Samaritan was not able to reach the girl and swam safely back to shore, he said.
Two surfers in the area then went out and got the girl and brought her back to shore, where San Francisco emergency responders had arrived to treat her, according to Eastman.
A Coast Guard crew was also responding to the area but was called off after the girl was brought back to shore.
The girl was conscious and breathing when she arrived back on shore. She was taken to San Francisco General Hospital where she was in stable condition this evening, a San Francisco fire dispatcher said.