The tetravalency of carbon and its ability to form covalent bonds with itself and other elements enables large organic molecules with complex structures, functions and dynamics to be constructed. The varied electronic configurations and bonding patterns of inorganic elements, on the other hand, can impart diverse electronic, magnetic, catalytic and other useful properties to molecular-level structures. Some hybrid organic–inorganic materials that combine features of both chemistries have been developed, most notably metal–organic frameworks1, dense and extended organic–inorganic frameworks2 and coordination polymers3. Metal ions have also been incorporated into molecules that contain interlocked subunits, such as rotaxanes4, 5, 6, 7 and catenanes6, 8, and structures in which many inorganic clusters encircle polymer chains have been described9. Here we report the synthesis of a series of discrete rotaxane molecules in which inorganic and organic structural units are linked together mechanically at the molecular level. Structural units (dialkyammonium groups) in dumb-bell-shaped organic molecules template the assembly of essentially inorganic 'rings' about 'axles' to form rotaxanes consisting of various numbers of rings and axles. One of the rotaxanes behaves as a 'molecular shuttle'10: the ring moves between two binding sites on the axle in a large-amplitude motion typical of some synthetic molecular machine systems11, 12, 13, 14, 15. The architecture of the rotaxanes ensures that the electronic, magnetic and paramagnetic characteristics of the inorganic rings—properties that could make them suitable as qubits for quantum computers16, 17, 18—can influence, and potentially be influenced by, the organic portion of the molecule.