[reaction: see text] Cephalosporins and penicillins rearrange under the influence of mercury(II) trifluoroacetate in methanol to non-beta-lactam products. The mechanisms of the rearrangements are different in the two cases. Whereas the open-chain aminoacrylic acid derivative 4 is produced from cephalosporins, the oxazole 7 and the propionamide 6 derivatives are the products from penicillins.