Abstract The ultramafic massif of Balmuccia, northwestern Italy, shows a variety of deformation fabrics including some localized shear zones that resulted in nearly complete melting (pseudotachylyte). A series of peridotite specimens were collected near one of the pseudotachylyte fault veins to investigate the mechanisms of shear localization. The microstructural analyses show at least three deformation stages. The first (stage I) is nearly homogeneous deformation at low stress (~ 3 MPa) and high temperature (~ 1300–1500 K), followed by localized deformation (stage II) at a higher stress (~ 60 MPa) and moderate temperature (~ 1000–1150 K) and, finally, semi-brittle deformation (stage III) at a very high stress (~ 400 MPa) that resulted in the formation of pseudotachylyte. The stage II deformation resulted in relatively small strains in most areas but significant localized deformation leading to dynamic recrystallization occurred, the degree of which increases systematically toward the fault zone. Based on this observation, together with the observation that the brittle deformation post-dated dynamic recrystallization, we conclude that the shear localization in this locality occurred as a result of ductile deformation rather than brittle deformation. Various mechanisms of shear localization in the ductile regime are examined and we conclude that the grain-size reduction due to dynamic recrystallization at relatively high stresses and moderate temperatures is a probable mechanism of shear localization. The intermediate regime between dislocation and diffusion creep, where rheology is grain-size-sensitive yet continuous recrystallization occurs due to dislocation creep, is suggested to play an important role in shear localization in the upper mantle. The conditions of shear localization due to this mechanism are examined based on the laboratory data on creep and dynamic recrystallization. It is shown that shear localization occurs at relatively low temperatures and/or high stresses. Localized deformation in the continental lithosphere will occur well below the brittle-ductile transition (~ 10 km depth), down to ~ 40–80 km depth depending upon the geothermal gradient and water fugacity.