This occurs in two main settings, either during seafloor spreading during the formation of oceanic core complexes, or during the rifting apart of continental crust during break-up on non-volcanic passive margins.
In normal rates of seafloor spreading, the space created by rifting along a mid-ocean ridge is filled by magma, forming the standard oceanic crust, with a central magma chamber, crystallising out as gabbros and utramafic cumulates, feeding volcanic rocks (typically pillow lavas) via systems of dykes.
[1] Passive margins form during the break-up of existing continental masses as the product of progressive rifting.
The final result of this is exemplified in the West Iberian margin, where a combination of seismic reflection profiling and scientific drilling (ODP Legs 103, 149, and 173) have proved the presence of serpentinized continental mantle immediately below post-rift sedimentary rocks, confirming that the mantle was exhumed at the seafloor by the time continental break-up was complete.
[2] Ophiolites within the Alpine orogenic belt are dominantly serpentinized peridotites with very little evidence of pillow lavas and sheeted dykes and less gabbro than would be expected if they represented slices of normal oceanic crust.