Three-dimensional Vp and Vp/Vs velocity models for the Loma Prieta region were developed from the inversion of local travel time data (21,925 P arrivals and 1,116 S arrivals) from earthquakes, refraction shots, and blasts recorded on 1700 stations from the Northern California Seismic Network and numerous portable seismograph deployments. The velocity and density models and microearthquake hypocenters reveal a complex structure that includes a San Andreas fault extending to the base of the seismogenic layer. A body with high Vp extends the length of the rupture and fills the 5 km wide volume between the Loma Prieta mainshock rupture and the San Andreas and Sargent faults. We suggest that this body controls both the pattern of background seismicity on the San Andreas and Sargent faults and the extent of rupture during the mainshock, thus explaining how the background seismicity outlined the along-strike and depth extent of the mainshock rupture on a different fault plane 5 km away. New aftershock focal mechanisms, based on three-dimensional ray tracing through the velocity model, support a heterogeneous postseismic stress field and can not resolve a uniform fault normal compression. The subvertical (or steeply dipping) San Andreas fault and the fault surfaces that ruptured in the 1989 Loma Prieta earthquake are both parts of the San Andreas fault zone and this section of the fault zone does not have a single type of characteristic event.