
51 P.3d 484 (2002)
2002 MT 162
STATE of Montana, Plaintiff and Respondent,
v.
Alton Maurice PARKER, Defendant and Appellant.
No. 00-822.
Supreme Court of Montana.
Submitted on Briefs August 9, 2001.
Decided July 23, 2002.
Alton Maurice Parker, Deer Lodge, Montana (pro se), For Appellant.
Mike McGrath, Montana Attorney General, Jennifer Anders, Assistant Montana Attorney General, Helena, Montana; Fred R. Van Valkenburg, Missoula County Attorney, Missoula, Montana, For Respondent.
Justice JAMES C. NELSON delivered the Opinion of the Court.
¶ 1 Alton Maurice Parker appeals the denial of his petition for postconviction relief by the District Court for the Fourth Judicial District, Missoula County. Alton contends on appeal that when the District Court revoked his suspended sentence and resentenced him in 1999, the court's designation of Parker as a dangerous offender for purposes of parole eligibility under § 46-18-404, MCA, was illegal since that statute was repealed in 1995. We reverse and vacate that portion of the sentence designating Parker a dangerous offender.
¶ 2 We address the following issue on appeal: Is Parker entitled to retroactive application of the Legislature's repeal of § 46-18-404, MCA, the dangerous offender statute?

Factual and Procedural Background
¶ 3 Parker was convicted of robbery upon his plea of guilty entered in Missoula County in 1986. The court sentenced him to 40 years in Montana State Prison (MSP), with 20 years suspended, and designated him a dangerous offender for parole eligibility purposes.
*485 ¶ 4 Parker was paroled from MSP in January 1991. While on parole, Parker was convicted of armed robbery in Washington state on July 1, 1992. Prior to Parker's discharge from his Washington sentence, the Missoula County Attorney's office filed a petition to revoke the suspended portion of Parker's Montana sentence on the ground that he had violated the condition that he remain a law-abiding citizen. Parker ultimately admitted these allegations.
¶ 5 On September 17, 1999, the District Court Judge issued a written judgment revoking Parker's suspended sentence and ordering Parker to serve 20 years at MSP with 10 years suspended. The Judge further ordered that Parker register as a violent offender pursuant to §§ 46-23-504 through 506, MCA, for 10 years following his release from custody. The Judge also declared Parker to be a dangerous offender for parole eligibility purposes, even though the statute authorizing that designation had been repealed in 1995.
¶ 6 In January 2000, Parker filed a petition for postconviction relief in the District Court alleging that the dangerous offender designation imposed in 1999 constituted an ex post facto application of the law. Before the court could rule on this petition, Parker filed a second petition for postconviction relief requesting credit for time served in the county jail. On August 16, 2000, the District Court denied Parker's request for good time credits, but the court neglected to rule on the ex post facto issue.
¶ 7 Rather than requesting a ruling from the District Court on the outstanding issue, Parker filed a notice of appeal on October 20, 2000. Parker's notice of appeal stated that he was appealing from a "final judgment entered in this action on the 8th day of August, 2000." The State concedes for purposes of appeal that the District Court's order of August 16, 2000, denying postconviction relief, is a final judgment and that Parker is entitled to present the ex post facto issue on appeal, even though the District Court did not specifically rule on that issue.

Discussion
¶ 8 Is Parker entitled to retroactive application of the Legislature's repeal of § 46-18-404, MCA, the dangerous offender statute?
¶ 9 We review a criminal sentence to determine whether the sentence is lawful. State v. Gustafson, 2000 MT 364, ¶ 15, 303 Mont. 386, ¶ 15, 15 P.3d 944 ¶ 15 (citing State v. Montoya, 1999 MT 180, ¶ 15, 295 Mont. 288, ¶ 15, 983 P.2d 937, ¶ 15).
¶ 10 In 1995, the Montana Legislature repealed § 46-18-404, MCA, which required sentencing judges to make a determination of whether an offender was dangerous or non-dangerous for parole eligibility purposes. See 1995 Mont. Laws § 12, ch. 372. Prior to the repeal of § 46-18-404, MCA, those persons designated as dangerous offenders would serve half of their sentence, less good time, before becoming eligible for parole and those persons designated as nondangerous offenders would serve one-quarter of their sentence, less good time, before becoming eligible for parole. Section 46-23-201(2), MCA (1993).
¶ 11 In the case sub judice, Parker was designated a dangerous offender for purposes of parole eligibility when he was originally sentenced in 1986. Parker argues on appeal that the District Court erred in designating him a dangerous offender when the court revoked his suspended sentence and resentenced him in 1999, because the Legislature had repealed § 46-18-404, MCA, in 1995.
¶ 12 The State notes at the outset that Parker changed his theory on appeal from an ex post facto analysis to a due process and equal protection analysis. The State concedes that irrespective of the basis for Parker's claim, the District Court had no authority to impose a dangerous offender designation in 1999 when the dangerous offender designation in § 46-18-404, MCA, had been repealed in 1995. Thus, the State asserts that the only question on appeal is whether the error was harmless in light of the fact that the District Court had other statutory means by which it could restrict Parker's parole eligibility and whether this Court should modify the judgment in order *486 to effectuate the intentions of the sentencing judge or strike the dangerous offender designation.
¶ 13 The State argues that even though a dangerous offender designation was no longer available after April 12, 1995 (the effective date of repeal of § 46-18-404, MCA), the District Court had the authority to accomplish the same result by restricting parole eligibility under § 46-18-202, MCA (1995), which provides in pertinent part:
Additional restrictions on sentence. (1) The court may also impose any of the following restrictions or conditions on the sentence provided for in XX-XX-XXX that it considers necessary to obtain the objectives of rehabilitation and the protection of the victim and society:
....
(2) Whenever the district court imposes a sentence of imprisonment in the state prison for a term exceeding 1 year, the court may also impose the restriction that the defendant is ineligible for parole and participation in the supervised release program while serving that term. If the restriction is to be imposed, the court shall state the reasons for it in writing. If the court finds that the restriction is necessary for the protection of society, it shall impose the restriction as part of the sentence and the judgment must contain a statement of the reasons for the restriction.
Section 46-18-202, MCA, was in effect when Parker was originally sentenced in 1986 and was still in effect when Parker was sentenced again in 1999 following the revocation of his suspended sentence. Hence, the State contends that because the District Court had the statutory authority to declare Parker ineligible for parole for a term of years, we should carry out the court's intentions regarding the sentence and modify the judgment accordingly, rather than simply striking the dangerous offender designation.
¶ 14 We disagree and we hold that the proper remedy in this case is to strike that portion of the sentence that is illegal and to amend the judgment to that limited extent. See State v. Shockley, 2001 MT 180, ¶ 11, 306 Mont. 196, ¶ 11, 31 P.3d 350, ¶ 11 (citing State v. Leistiko (1992), 256 Mont. 32, 844 P.2d 97). See also Gustafson, ¶ 25; State v. Aguilar, 1999 MT 159, ¶ 10, 295 Mont. 133, ¶ 10, 983 P.2d 345, ¶ 10; State v. Roullier, 1999 MT 37, 293 Mont. 304, 977 P.2d 970.
¶ 15 Accordingly, we reverse and vacate that portion of the sentence designating Parker a dangerous offender.
¶ 16 Vacated in part.
KARLA M. GRAY, W. WILLIAM LEAPHART, TERRY N. TRIEWEILER and JIM REGNIER, concur.
