The San Andreas fault (California, USA) is near vertical at shallow (<10 km) depth. Geophysical surveys along the San Andreas fault reveal that, at depths of 10-20 km, it dips similar to 50-70 degrees to the southwest near the Western Transverse Ranges and dips northeast in the San Gorgonio region. We investigate the possible origin of along-strike geometric variations of the fault using a three-dimensional thermomechanical model. For two blocks separated by transpressional faults, our model shows that viscous lower crustal material moves from the high-viscosity block into the low-viscosity block. Fault plane-normal flow in the viscous lower crust rotates the fault plane due to the simple shear flow at the brittle-ductile transition depth. This occurs irrespective of initial fault dip direction. Rheological variations used to model the lower crust of Southern California are verified by independent observations. Block extrusion due to lower crustal viscosity variation facilitates the formation of the Garlock Fault and sustains the geometric complexity of the fault.