Seismic travel times from the northern California earthquake catalogue and from the 1991 Bay Area Seismic Imaging Experiment (BASIX) refraction survey were used to obtain a three-dimensional model of the seismic velocity structure of the San Francisco Bay area. Nonlinear tomography was used to simultaneously invert for both velocity and hypocenters. The new hypocenter inversion algorithm uses finite difference travel times and is an extension of an existing velocity tomography algorithm. Numerous inversions were performed with different parameters to test the reliability of the resulting velocity model. Most hypocenters were relocated <2 km from their catalogue locations. Large lateral velocity variations at shallow (<4 km) depth correlate with known surface geology, including low-velocity Cenozoic sedimentary basins, high-velocity Cenozoic volcanic rocks, and outcrop patterns of the major Mesozoic geologic terranes. Salinian arc rocks have higher velocities than the Franciscan melange, which in turn are faster than Great Valley Sequence forearc rocks. The thickess of low-velocity sediment is defined, including >12 km under the Sacramento River Delta, 6 km beneath Livermore Valley, 5 km beneath the Santa Clara Valley, and 4 km beneath eastern San Pablo Bay. The Great Valley Sequence east of San Francisco Bay is 4-6 km thick. A relatively high velocity body exists in the upper 10 km beneath the Sonoma volcanic field, but no evidence for a large intrusion or magma chamber exists in the crust under The Geysers or the Clear Lake volcanic center. Lateral velocity contrasts indicate that the major strike-slip faults extend subvertically beneath their surface locations through most of the crust. Strong lateral velocity contrasts of 0.3-0.6 km/s are observed across the San Andreas Fault in the middle crust and across the Hayward, Rogers Creek, Calaveras, and Greenville Faults at shallow depth. Weaker velocity contrasts (0.1-0.3 km/s) exist across the San Andreas, Hayward, and Rogers Creek Faults at all other depths. Low spatial resolution evidence in the lower crust suggests that the top of high-velocity mafic rocks gets deeper from west to east and may be offset under the major faults. The data suggest that the major strike-slip faults extend subvertically through the middle and perhaps the lower crust and juxtapose differing lithology due to accumulated strike-slip motion. The extent and physical properties of the major geologic units as constrained by the model should be used to improve studies of seismicity, strong ground motion, and regional stress.