Three-dimensional models of the CB1 and CB2 cannabinoid receptors were constructed by means of a molecular modeling procedure, using the X-ray structure of bovine rhodopsin as the initial template, and taking into account the available site-directed mutagenesis data. The cannabinoid system was studied by means of docking techniques. An analysis of the interaction of WIN55212-2 with both receptors showed that CB2/CB1 selectivity is mainly determined by the interaction in the CB2 with the nonconserved residues S3.31 and F5.46, whose importance was suggested by site-directed mutagenesis data. We also carried out an automated docking of several ligands into the CB2 model, using the AUTODOCK 3.0 program; the good correlation obtained between the estimated free energy binding and the experimental binding data confirmed our binding hypothesis and the reliability of the model.