The segmentation of brain tissue from nonbrain tissue in magnetic resonance (MR) images, commonly referred to as skull stripping, is an important image processing step in many neuroimage studies. A new mathematical algorithm, a model-based level set (MLS), was developed for controlling the evolution of the zero level curve that is implicitly embedded in the level set function. The evolution of the curve was controlled using two terms in the level set equation, whose values represented the forces that determined the speed of the evolving curve. The first force was derived from the mean curvature of the curve, and the second was designed to model the intensity characteristics of the cortex in MR images. The combination of these forces in a level set framework pushed or pulled the curve toward the brain surface. Quantitative evaluation of the MLS algorithm was performed by comparing the results of the MLS algorithm to those obtained using expert segmentation in 29 sets of pediatric brain MR images and 20 sets of young adult MR images. Another 48 sets of elderly adult MR images were used for qualitatively evaluating the algorithm. The MLS algorithm was also compared to two existing methods, the brain extraction tool (BET) and the brain surface extractor (BSE), using the data from the Internet brain segmentation repository (IBSR). The MLS algorithm provides robust skull-stripping results, making it a promising tool for use in large, multi-institutional, population-based neuroimaging studies.