To understand the structural features that dictate the selectivity of diverse nonsteroidal antiinflammatory drugs for the two isoforms of the human prostaglandin H2 synthase (PGHS), the three-dimensional (3D) structure of human COX-2 was assessed by means of sequence homology modeling. The ovine COX-1 structure, solved by X-ray diffraction methods and sharing a 61% sequence identity with human COX-2, was used as template. Both structures were energy minimized using the AMBER 4.0 force field with a dielectric constant of 4r. (S)-Flurbiprofen, a nonselective COX inhibitor, and SC-558, a COX-2-selective ligand, were docked at the cyclooxygenase binding site in both isozymes, evidencing the role of different residues in the ligand-protein interaction. The 3D structures of the constructed four ligand-enzyme complexes were refined by energy minimization. Molecular dynamics simulations were also carried out, to understand more deeply the structural origins of the selectivity. Distances calculated during the dynamics process between the different ligands and the interacting residues of the two PGHS isozymes provided evidence of the flexible nature of the cyclooxygenase active site, permitting the identification of different conserved and nonconserved residues as responsible for ligand selectivity.