The conformation of complementarity-determining regions (CDRs) of several immunoglobulins is modeled using statistical mechanics techniques. Observed conformations of polypeptide chains correspond to the time average of all the microscopic conformations available to the protein. Therefore, we argue that average properties calculated over the proper ensemble (the canonical ensemble) provide a better estimate of the observed properties, such as the conformation, than, for example, energy minimization does. This is true if the average is performed on a portion of configuration space effectively sampled by the protein at room temperature. To avoid being trapped in the basin of attraction of some remote local minimum, we use a simulated annealing scheme intended to allow the simulation to reach the region of configuration space corresponding to the native conformation. The specific simulated annealing process that we use, ESAP (extended simulated annealing process), allows the reconstruction of the entire complementarity-determining region (six loops) of Hyhel-5 antibody with a rmsd of 0.7 A for the C α atoms and about 2 A for all the atoms. Tested on two other antibodies, McPC603 and J539, modeling of individual loops gives a very similar accuracy. Improvements in the methodology used, such as Monte Carlo efficiency, and sources of limitation on the modeling accuracy, for example, X-ray resolution, calculated internal energy, proline configurations, presence of other loops, or antigen molecule in the model, are discussed.