myo-Inositol monophosphatase (IMPase), a putative target of lithium therapy for bipolar disorder, is an enzyme that catalyzes the hydrolysis of myo-inositol-1-phosphate (Ins(1)P) into myo-inositol (MI) and inorganic phosphate. It is known that either two or three Mg(2+) ions are used as cofactors in IMPase catalysis; however, the detailed catalytic mechanism and the specific number of Mg(2+) ions required have long remained obscure. To obtain a clearer view of the IMPase reaction, we undertook extensive ONIOM hybrid quantum mechanics and molecular mechanics (QM/MM) calculations, to evaluate the reaction with either three or two Mg(2+) ions. Our calculations show that the three-metal mechanism is energetically unfavorable; the initial inline attack of a hydroxide ion on the Ins(1)P substrate markedly destabilized the system without producing any stable transition state or intermediate. By contrast, for the two-metal mechanism, a favorable pathway was obtained from QM/MM calculations. In our proposed two-metal mechanism, the phosphoryl oxygen of the substrate acts as an acid-base catalyst, activating a water molecule in the first step, and the resultant hydroxide ion attacks the substrate in an inline fashion. A second water molecule, bound to a Mg(2+) ion, was found to play an essential role in the final proton-transfer step that leads to the formation of an MI product; this is achieved by lowering the energy barrier by 2.5 kcal/mol compared with the barrier for the mechanism that does not use this water molecule. Our results should advance our understanding of the IMPase mechanism, and this could have profound implications for the treatment of disease in the central nervous system.