The synthesis of 2 beta-(heterocyclylthiomethyl)penam derivatives on solid support has been developed. Compounds are obtained in good to high yields (based on loading of the original resin). The key step is the solid-phase double rearrangement of the corresponding penicillin sulfoxide.