KRASG12C is the most prevalent KRAS mutation in non-small cell lung cancer (NSCLC) and has emerged as a promising therapeutic target. Herein, two series of novel 4(1H)-quinolinone and urea compounds were designed based on the reported KRASG12C inhibitor SH-9. Many compounds showed significantly growth inhibitory activity against human NSCLC cells with KRASG12C mutation in cell viability assays. Compound 20a exhibited an IC50 value of 0.5 μM in KRASG12C-mutant NCI–H358 cells with 21-fold selectivity over KRASWT NCI–H2228 cells. LC-MS analysis indicated that compounds 14c, 14h and 20a covalently bound to KRASG12C rather than KRASWT. Moreover, these compounds could remarkably trap KRASG12C in its inactive state by blocking SOS1-mediated GDP/GTP exchange. Furthermore, treatment of NCI–H358 but not NCI–H2228 cells with 20a dose-dependently reduced the phosphorylation of KRAS downstream effectors ERK and AKT. Importantly, 20a significantly inhibited tumor growth in NCI–H358 xenograft models by suppressing KRASG12C signalling. These results indicate that 20a is a promising candidate worthy of further investigation.