Sea ice plays an important role in climate change research and maritime shipping safety, and SAR imaging technology provides important technical support for sea ice extraction. However, traditional methods have limitations such as low efficiency, model complexity, and excessive human interference. For that, a novel sea ice segmentation algorithm based on a spatially constrained Gamma mixture model (GaMM) is proposed in this paper. The advantage of the proposed algorithm is automatic, efficient, and accurate sea ice extraction. The algorithm first uses GaMM to build the probability distribution of sea ice in SAR images. Considering the similarity in the class attributions of local pixels, the smoothing coefficient is defined by the class attributes of neighboring pixels. Then, the prior distribution of the label is modeled by combining Gibbs distribution and the smoothing coefficient to improve the accuracy of sea ice extraction. The proposed algorithm utilizes the Expectation maximization method to estimate model parameters, and determines the optimal number of classes using Bayesian information criteria, aiming to achieve fast and automatic sea ice extraction. To test the effectiveness of the proposed algorithm, numerous experiments were conducted on simulated and real high-resolution SAR images. The results show that the proposed algorithm has high accuracy and efficiency. Moreover, the proposed algorithm can obtain the optimal number of classes and avoid over-segmentation or under-segmentation caused by manually setting the number of classes.