We have developed an automatic approach for homology modeling using restrained molecular dynamics and simulated annealing procedures, together with conformational search algorithms available in the molecular mechanics program CONGEN (Bruccoleri RE, Karplus M, 1987, Biopolymers 26:137-168). The accuracy of the method is validated by "predicting" structures of two homeodomain proteins with known three-dimensional structures, and then applied to predict the three-dimensional structure of the homeodomain of the murine Msx-1 transcription factor. Regions of the unknown protein structure that are highly homologous to the known template structure are constrained by "homology distance constraints," whereas the conformations of nonhomologous regions of the unknown protein are defined only by the potential energy function. A full energy function (excluding explicit solvent) is employed to ensure that the calculated structures have good conformational energies and are physically reasonable. As in NMR structure determinations, information on the consistency of the structure prediction is obtained by superposition of the resulting family of protein structures. In this paper, our homology modeling algorithm is described and compared with related homology modeling methods using spatial constraints derived from the structures of homologous proteins. The software is then used to predict the DNA-bound structures of three homeodomain proteins from the X-ray crystal structure of the engrailed homeodomain protein (Kissinger CR et al., 1990, Cell 63:579-590). The resulting backbone and side-chain conformations of the modeled yeast Mat alpha 2 and D. melanogaster Antennapedia homeodomains are excellent matches to the corresponding published X-ray crystal (Wolberger C et al., 1991, Cell 67:517-528) and NMR (Billeter M et al., 1993, J Mol Biol 234:1084-1097) structures, respectively. Examination of these structures of Msx-1 reveals a network of highly conserved surface salt bridges that are proposed to play a role in regulating protein-protein interactions of homeodomains in transcription complexes.