ATP synthase is the universal enzyme that manufactures ATP from ADP and phosphate by using the energy derived from a transmembrane protonmotive gradient. It can also reverse itself and hydrolyse ATP to pump protons against an electrochemical gradient. ATP synthase carries out both its synthetic and hydrolytic cycles by a rotary mechanism. This has been confirmed in the direction of hydrolysis, after isolation of the soluble F1 portion of the protein and visualization of the actual rotation of the central `shaft' of the enzyme with respect to the rest of the molecule, making ATP synthase the world's smallest rotary engine. Here we present a model for this engine that accounts for its mechanochemical behaviour in both the hydrolysing and synthesizing directions. We conclude that the F1 motor achieves its high mechanical torque and almost 100% efficiency because it converts the free energy of ATP binding into elastic strain, which is then released by a coordinated kinetic and tightly coupled conformational mechanism to create a rotary torque.