The relationship between formation of active in-line attack conformations and monovalent (Na+) and divalent (Mg2+) metal ion binding in hammerhead ribozyme (HHR) has been explored with molecular dynamics simulations. To stabilize repulsions between negatively charged groups, different requirements of the threshold occupancy of metal ions were observed in the reactant and activated precursor states both in the presence and in the absence of a Mg2+ in the active site. Specific bridging coordination patterns of the ions are correlated with the formation of active in-line attack conformations and can be accommodated in both cases. Furthermore, simulation results suggest that the HHR folds to form an electronegative recruiting pocket that attracts high local concentrations of positive charge. The present simulations help to reconcile experiments that probe the metal ion sensitivity of HHR catalysis and support the supposition that Mg2+, in addition to stabilizing active conformations, plays a specific chemical role in catalysis.