We have performed docking studies with the SYSDOC program on acetylcholinesterase (AChE) to predict the binding sites in AChE of huperzine A (HA), which is a potent and selective, reversible inhibitor of AChE. The unique aspects of our docking studies include the following: (i) Molecular flexibility of the guest and the host is taken into account, which permits both to change their conformations upon binding. (ii) The binding energy is evaluated by a sum of energies of steric, electrostatic and hydrogen bonding interactions. In the energy calculation no grid approximation is used, and all hydrogen atoms of the system are treated explicitly. (iii) The energy of cation-pi interactions between the guest and the host, which is important in the binding of AChE, is included in the calculated binding energy. (iv) Docking is performed in all regions of the host's binding cavity. Based on our docking studies and the pharmacological results reported for HA and its analogs, we predict that HA binds to the bottom of the binding cavity of AChE (the gorge) with its ammonium group interacting with Trp84, Phe330, Glu199 and Asp72 (catalytic site) and to the opening of the gorge with its ammonium group partially interacting with Trp279 (peripheral site). At the catalytic site, three partially overlapping subsites of HA were identified which might provide a dynamic view of binding of HA to the catalytic site.