A 26-year-old man was shot in the hand in San Francisco’s Golden Gate Park over the weekend, but police didn’t know about it until he walked into a hospital on Wednesday to get his wound treated, officials said.

The victim said he heard shots in the park around 7 p.m. Sunday, then ran away before noticing he was hit, said Officer Robert Rueca, a San Francisco Police Department spokesman.

The man declined to offer further details to police, including where his exact location was in the 1,000-acre park, Rueca said.

“According to him he got the injury on the ninth and ... had been walking around a good two to three days,” Rueca said. “He just heard gunshots, ran away — he wasn’t with anyone — then realized he had an injury.”

The man sought treatment at a San Francisco hospital Wednesday when medical staff alerted police, who interviewed him, Rueca added.

The victim did not see any suspects. No arrests have been made.

Jenna Lyons is a San Francisco Chronicle staff writer. Email: jlyons@sfchronicle.com Twitter: @JennaJourno