An implant, preferably a stent, which has a main body made of magnesium or a biocorrodible magnesium alloy and a corrosion-inhibiting passivation layer covering the main body. The passivation layer is characterized in that it contains a composite of a biodegradable polymer and nanoparticles of clay minerals.