Platinum is a much used catalyst that, in petrochemical processes, is often alloyed with other metals to improve catalytic activity, selectivity and longevity1,2,3,4,5. Such catalysts are usually prepared in the form of metallic nanoparticles supported on porous solids, and their production involves reducing metal precursor compounds under a H2 flow at high temperatures6. The method works well when using easily reducible late transition metals, but Pt alloy formation with rare-earth elements through the H2 reduction route is almost impossible owing to the low chemical potential of rare-earth element oxides6. Here we use as support a mesoporous zeolite that has pore walls with surface framework defects (called ‘silanol nests’) and show that the zeolite enables alloy formation between Pt and rare-earth elements. We find that the silanol nests enable the rare-earth elements to exist as single atomic species with a substantially higher chemical potential compared with that of the bulk oxide, making it possible for them to diffuse onto Pt. High-resolution transmission electron microscopy and hydrogen chemisorption measurements indicate that the resultant bimetallic nanoparticles supported on the mesoporous zeolite are intermetallic compounds, which we find to be stable, highly active and selective catalysts for the propane dehydrogenation reaction. When used with late transition metals, the same preparation strategy produces Pt alloy catalysts that incorporate an unusually large amount of the second metal and, in the case of the PtCo alloy, show high catalytic activity and selectivity in the preferential oxidation of carbon monoxide in H2.