Phase-change materials undergo rapid and reversible crystalline-to- amorphous structural transformation and are being used for nonvolatile memory devices. However, the transformation mechanism remains poorly understood. We have studied the effect of electrical pulses on the crystalline-to-amorphous phase change in a single-crystalline Ge2Sb2Te5 (GST) nanowire memory device by in situ transmission electron microscopy. We show that electrical pulses produce dislocations in crystalline GST, which become mobile and glide in the direction of hole-carrier motion. The continuous increase in the density of dislocations moving unidirectionally in the material leads to dislocation jamming, which eventually induces the crystalline-to- amorphous phase change with a sharp interface spanning the entire nanowire cross section. The dislocation-templated amorphization explains the large on/off resistance ratio of the device.