The synthetic production of monodisperse single magnetic domain nanoparticles at ambient temperature is challenging. In nature, magnetosomes--membrane-bound magnetic nanocrystals with unprecedented magnetic properties--can be biomineralized by magnetotactic bacteria. However, these microbes are difficult to handle. Expression of the underlying biosynthetic pathway from these fastidious microorganisms within other organisms could therefore greatly expand their nanotechnological and biomedical applications. So far, this has been hindered by the structural and genetic complexity of the magnetosome organelle and insufficient knowledge of the biosynthetic functions involved. Here, we show that the ability to biomineralize highly ordered magnetic nanostructures can be transferred to a foreign recipient. Expression of a minimal set of genes from the magnetotactic bacterium Magnetospirillum gryphiswaldense resulted in magnetosome biosynthesis within the photosynthetic model organism Rhodospirillum rubrum. Our findings will enable the sustainable production of tailored magnetic nanostructures in biotechnologically relevant hosts and represent a step towards the endogenous magnetization of various organisms by synthetic biology.