Recent advances in strategies for synthesizing nanoparticles--such as semiconductor quantum dots, magnets and noble-metal clusters--have enabled the precise control of composition, size, shape, crystal structure, and surface chemistry. The distinct properties of the resulting nanometre-scale building blocks can be harnessed in assemblies with new collective properties, which can be further engineered by controlling interparticle spacing and by material processing. Our study is motivated by the emerging concept of metamaterials-materials with properties arising from the controlled interaction of the different nanocrystals in an assembly. Previous multi-component nanocrystal assemblies have usually resulted in amorphous or short-range-ordered materials because of non-directional forces or insufficient mobility during assembly. Here we report the self-assembly of PbSe semiconductor quantum dots and Fe2O3 magnetic nanocrystals into precisely ordered three-dimensional superlattices. The use of specific size ratios directs the assembly of the magnetic and semiconducting nanoparticles into AB13 or AB2 superlattices with potentially tunable optical and magnetic properties. This synthesis concept could ultimately enable the fine-tuning of material responses to magnetic, electrical, optical and mechanical stimuli.