Mechanical metamaterials are artificial structures whose properties originate from their geometry. In such structures, it is now shown that topological modes can exist that are robust against a range of structural deformations. Mechanical metamaterials are artificial structures with unusual properties, such as negative Poisson ratio, bistability or tunable vibrational properties, that originate in the geometry of their unit cell1,2,3,4,5. Often at the heart of such unusual behaviour is a soft mode: a motion that does not significantly stretch or compress the links between constituent elements. When activated by motors or external fields, soft modes become the building blocks of robots and smart materials. Here, we demonstrate the existence of topological soft modes that can be positioned at desired locations in a metamaterial while being robust against a wide range of structural deformations or changes in material parameters6,7,8,9,10. These protected modes, localized at dislocations in deformed kagome and square lattices, are the mechanical analogue of topological states bound to defects in electronic systems11,12,13,14. We create physical realizations of the topological modes in prototypes of kagome lattices built out of rigid triangular plates. We show mathematically that they originate from the interplay between two Berry phases: the Burgers vector of the dislocation and the topological polarization of the lattice. Our work paves the way towards engineering topologically protected nanomechanical structures for molecular robotics or information storage and read-out.