Let E/Q be an elliptic curve, let p>2 be a prime of good reduction for E, and assume that E admits a rational p-isogeny with kernel Fp(I¨). In this paper we prove the cyclotomic Iwasawa main conjecture for E, as formulated by Mazur in 1972, when I¨∣Gp=1,I¨, where Gp is a decomposition group at p and I¨ is the Teichmüller character. Our proof is based on a study of the anticyclotomic Iwasawa theory of E over an imaginary quadratic field K in which p splits, and a congruence argument exploiting the cyclotomic Euler system of Beilinson--Flach classes.