Oncogenic alterations in the RAS/RAF/MEK/ERK pathway drive the growth of a wide spectrum of cancers. While BRAF and MEK inhibitors are efficacious against BRAFV600E-driven cancers, effective targeted therapies are lacking for most cancers driven by other pathway alterations, including non-V600E oncogenic BRAF, RAS GTPase-activating protein (GAP) NF1 (neurofibromin 1) loss and oncogenic KRAS. Here, we show that targeting the SHP2 phosphatase (encoded by PTPN11) with RMC-4550, a small-molecule allosteric inhibitor, is effective in human cancer models bearing RAS-GTP-dependent oncogenic BRAF (for example, class 3 BRAF mutants), NF1 loss or nucleotide-cycling oncogenic RAS (for example, KRASG12C). SHP2 inhibitor treatment decreases oncogenic RAS/RAF/MEK/ERK signalling and cancer growth by disrupting SOS1-mediated RAS-GTP loading. Our findings illuminate a critical function for SHP2 in promoting oncogenic RAS/MAPK pathway activation in cancers with RAS-GTP-dependent oncogenic BRAF, NF1 loss and nucleotide-cycling oncogenic KRAS. SHP2 inhibition is a promising molecular therapeutic strategy for patients with cancers bearing these oncogenic drivers