This paper presents the application of competitive Hopfield neural network (CHNN) for medical images segmentation. Our proposed approach consists of two steps: 1) translating segmentation of the given medical image into an optimization problem, and 2) solving this problem by a version of Hopfield network known as CHNN. Segmentation is considered as a clustering problem and its validity criterion is based on both intraset distance (IAD) and interset distance (IED). The algorithm proposed in this paper is based on gray level features only. This leads to near optimal solutions if both IAD and IED are considered at the same time. If only one of these distances is considered, the result of segmentation process by CHNN will be far from optimal solution and incorrect even for very simple cases. Furthermore, sometimes the algorithm receives at unacceptable states. Both these problems may be solved by contributing both IAD and IEDdistances in the segmentation (optimization) process. The performance of the proposed algorithm is tested on both phantom and real medical images. The promising results and the robustness of algorithm to system noises show near optimal solutions.