A control algorithm is designed and implemented experimentally for the simultaneous closed-loop control of the composition and number-average molecular weight of a copolymer latex. The developed control algorithm is based on a predictive control strategy and uses an iterative dynamic programming (IDP) algorithm for process optimization and design of the optimum dynamic trajectories at each sampling time. The control of semibatch methyl methacrylate (MMA) and butyl acrylate (BuA) emulsion copolymerizations is used to illustrate the approach. Monomer compositions and polymer holdup are measured in-line and in situ with the help of near-infrared spectroscopy (NIRS), while average molecular weights are inferred with the help of a process model. The manipulated variables are the flow rates of three distinct feed streams, which contain known concentrations of both monomer species and of a chain-transfer agent. The results obtained when different process disturbances are introduced, such as feed failure and addition of unknown amounts of inhibitor to the reactor charge, show unequivocally that NIRS can be used successfully for the in-line and in situ simultaneous control of copolymer composition and average molecular weights in emulsion copolymerizations.