The incident was reported at about 11:15 p.m. Monday near 11th and Kissling streets.
The 40-year-old guard was fastening his seat belt when the belt interfered with his holster, causing the gun to discharge, police said. The man suffered a gunshot wound to his right leg and was taken to San Francisco General Hospital to be treated, police said.