We report the detection of the prebiotic molecule CH3NCO in a solar-type protostar, IRAS16293-2422 B. A significant abundance of this species on the surface of the comet 67P/Churyumov-Gerasimenko has been proposed, and it has recently been detected in hot cores around high-mass protostars. We observed IRAS16293-2422 B with ALMA in the 90 GHz to 265 GHz range, and detected 8 unblended transitions of CH3NCO. From our Local Thermodynamic Equilibrium analysis we derived an excitation temperature of 110+-19 K and a column density of (4.0+-0.3)x10^15 cm^-2 , which results in an abundance of <=(1.4+-0.1)x10^-10 with respect to molecular hydrogen. This implies a CH3NCO/HNCO and CH3NCO/NH2CHO column density ratios of ~0.08. Our modelling of the chemistry of CH3NCO suggests that both ice surface and gas phase formation reactions of this molecule are needed to explain the observations.