An automated procedure for locating the positions of heavy atoms in crystals of macromolecules has been developed. The method is simple to apply, is independent of space group, and permits inclusion of non-crystallographic symmetry. The procedure is a search of the difference Patterson function; a trial solution consisting of a set of heavy-atom sites is considered likely to be correct only if the corresponding 'minimum function' (the minimum value of the difference Patterson function at the self- and crossvector positions for this group of sites) is large. Although the method may be used to search for 'single-site' solutions to the difference Patterson function, it is more effectively used to search for pairs of sites unrelated by crystallographic symmetry. In the latter case the number of predicted cross vectors for each trial solution is larger, and correct solutions may be more readily distinguished from incorrect ones. Because of noise in difference Patterson functions, it is helpful in evaluating the solutions obtained to calculate the probability that a given value of the minimum function might occur by chance. The method has been applied to nine difference Patterson functions for which solutions were known. In eight of these cases, including several which had resisted earlier attempts at interpretation, this procedure yielded at least half of the known sites.