Children found the pistol at the Visitacion Valley playground Tuesday afternoon and told adults.
Police arrived before anything tragic happened.
Police say the weapon is a 380 Beretta, and that it was cocked, with a bullet in the chamber -- meaning it was ready to be fired, when the kids found it.
Investigators are looking into whether the same gun was used in a shooting Sunday at the intersection of Wilde Avenue and Rutland Street.
One person suffered injuries in that shooting.
No arrests have been made.