A procedure for fitting a molecular model with fixed bond lengths and bond angles to a set of Cartesian coordinates has been developed. This procedure is designed to fit coordinates obtained from an X-ray electron-density map, although it can also fit coordinate sets from other sources. It differs from other model-building methods which use fixed bond lengths and bond angles in that it takes cognizance of certain information present in the electron-density map, which is ignored in other methods. The inherent uncertainty in the values of the coordinates determined from the map influences the fitting; i.e., if the computed location of an atom of the model is within the uncertainty assigned to the corresponding coordinate derived from the map, the fit of the atom of the model is assigned as exact. Also, the fitting process may begin anywhere along the molecular chain, in contrast to other procedures which commence fitting at or near one end of the chain. Thus, the present procedure can avoid errors that might arise if the starting point were chosen in a region where the atoms are poorly defined, as they often are at the ends of the chain. The procedure is designed to be used with a large amount of operator intervention, making it fairly flexible. Complete mathematical details of the method are given. A Fortran IV computer program using the method to fit a polypeptide model to a set of Cartesian coordinates has been written. The program has been used to fit a model of bovine pancreatic trypsin inhibitor to Cartesian coordinates derived from the 2-5 A resolution electron-density map. The r.m.s. deviation between the model and the weighted coordinates from the map was 0.49 A. As a preliminary step in a refinement of the 2.5 A structure by potentialenergy-constrained model building, the model obtained here was subjected to energy minimization with the atomic coordinates constrained to remain 'close' to the original guide points.