According to the San Francisco Chronicle, the semiautomatic Glock-23 was purchased from a store in downtown Phoenix.
The gun is popular among police officers.
RELATED: San Francisco 49ers' Ricky Pearsall shot in attempted robbery at Union Square, authorities confirm
SF 49ers' Ricky Pearsall shot in attempted robbery: authorities
Pearsall was shot on August 31 in Union Square.
It's unclear how the weapon crossed state lines into California and got to the Bay Area. The identity of the person who purchased the gun was not released in the SF Chronicle report.
RELATED: Attorney for teen accused of shooting Ricky Pearsall denies reports he brandished a gun at school
The 17-year-old boy accused of shooting Pearsall is charged with attempted murder.
The San Francisco District Attorney's Office is pursuing the case in the juvenile justice system.
If you're on the ABC7 News app, click here to watch live