The molecular-replacement method has been extended to locate molecules and their fragments in an electron-density map. The approach is based on a new spherically averaged phased translation function. The position of the centre of mass of a search model is found prior to determination of its orientation. The orientation is subsequently found by a phased rotation function. The technique also allows superposition of distantly related macromolecules. The method has been implemented in a computer program MOLREP and successfully tested using experimental data sets.