Brain tumor is a dreadful disease which occurs when abnormal cells form uncontrollably. The modality adopted to detect abnormalities is Magnetic Resonance Imaging (MRI). MRI brain images contain nonbrain tissues. One of the important preprocessing steps is the whole brain segmentation, the process of skull stripping which isolates brain tissue and non-brain tissue. Segmentation is tedious and consumes more time only well experienced radiologist or a clinical expert can perform it with best accuracy. In order to overcome these limitations, computer aided medical diagnosis is essential. In this work, an intelligent and a robust skull stripping algorithm using mathematical morphology suited for all types of MR sequences is proposed. The method was validated on the international database collected from whole brain Atlas. The performance was evaluated using the metrics Jaccard Similarity Coefficient (JSC), Dice Similarity Coefficient (DSC), False Positive Rate (FPR), False Negative Rate (FNR), sensitivity, specificity and accuracy. An average of 97.25% indicates better overlap between proposed skull stripping and manual stripping by radiologists as a gold standard. The simulation results proved high accuracy in comparison to the ground truth results which is evident from the similarity coefficient metrics.