§61-11-18. Punishment for second or third offense of felony.
(a) Except as provided by subsection (b) of this section, when any person is convicted of an offense and is subject to confinement in the state correctional facility therefor, and it is determined, as provided in section nineteen of this article, that such person had been before convicted in the United States of a crime punishable by confinement in a penitentiary, the court shall, if the sentence to be imposed is for a definite term of years, add five years to the time for which the person is or would be otherwise sentenced. Whenever in such case the court imposes an indeterminate sentence, the minimum term shall be twice the term of years otherwise provided for under such sentence.

(b) Notwithstanding the provisions of subsection (a) or (c) of this section or any other provision of this code to the contrary, when any person is convicted of first degree murder or second degree murder or a violation of section three, article eight-b of this chapter and it is determined, as provided in section nineteen of this article, that such person had been before convicted in this state of first degree murder, second degree murder or a violation of section three, article eight-b of said chapter or has been so convicted under any law of the United States or any other state for an offense which has the same elements as any offense described in this subsection, such person shall be punished by confinement in the state correctional facility for life and is not eligible for parole.

(c) When it is determined, as provided in section nineteen of this article, that such person shall have been twice before convicted in the United States of a crime punishable by confinement in a penitentiary, the person shall be sentenced to be confined in the state correctional facility for life.