The girl was swept out to sea at about 6:50 p.m. Sunday at the beach near the intersection of Great Highway and Sloat Boulevard, Coast Guard Petty Officer John Eastman said.
Noa Bourke, 25, was jogging on the beach when he noticed a commotion farther down, he said. He heard screams and jumped in the water, following the sound to find the girl.
Although others on the beach tried to help, Bourke reached the girl first and was able to get her arm around his neck and shoulder.
"It wasn't that deep, so I was able to go down, kick off the ground, and get her close enough to walk her in," he said.
Although he has no rescue training, Bourke grew up surfing and swimming in Hawaii and said he is more comfortable in water than on land.
He has saved a few family members and friends from the water before and come close to drowning himself.
"People are panicking," he said of those experiences.
Eastman, with the U.S. Coast Guard, said a woman also swam out to get the girl but couldn't find her. A surfer helped walk her in from the water to the beach, and several people assisted on land.
Emergency personnel were ready for her on the beach.
"It was good timing on everybody's part," Bourke said. "Everybody who went in the water is a hero in my book."
Bourke said the currents weren't especially dangerous that day, but that Ocean Beach has a nearly constant undertow.
A spokesman for the Golden Gate National Recreation Area said Ocean Beach has signs warning people not to go in the water, and people have drowned at the beach.
"People think that because they're just wading they're safe, and they don't realize that after a few minutes they could be in deeper," spokesman Michael Feinstein said. "The undertow just pulls them out."
The girl was conscious and breathing when she arrived back on shore, according to the San Francisco Fire Department. She was taken to San Francisco General Hospital where she was in stable condition Sunday evening.
Bourke said he hasn't talked to the girl since the rescue but hopes she is doing well.
"I would love to buy her lunch and make sure she's okay," he said.