
947 P.2d 262 (1997)
88 Wash.App. 817
STATE of Washington, Respondent,
v.
Wiley Floyd KISSEE, Appellant.
No. 19936-0-II.
Court of Appeals of Washington, Division 2.
November 21, 1997.
*263 George A. Kolin, Washougal, for Appellant.
Kimberley Robert Farr, Clark County Deputy Prosecuting Attorney, Vancouver, for Respondent.
MORGAN, Judge.
On December 21, 1994, the State charged Wiley F. Kissee in Clark County cause number XX-X-XXXXX-X. It alleged three counts of luring in violation of RCW 9A.40.090, and one count of communicating with a minor for immoral purposes in violation of RCW 9.68A.090. The communicating count did not allege a prior conviction, so it charged a gross misdemeanor rather than a felony. RCW 9.68A.090.
On March 1, 1995, the State charged Kissee in Clark County cause number XX-X-XXXXX-X. It alleged one count of first degree child molestation and one count of second degree child molestation.
On or before April 18, 1995, the parties agreed that if Kissee pled guilty to the four counts alleged in cause number XX-X-XXXXX-X, the State would dismiss the two counts alleged in cause number XX-X-XXXXX-X. In addition, they stipulated in writing:
3. The State shall be free to make any recommendation of prison or SSOSA to 48 months.
4. The defendant shall be free to attempt to seek the Special Sexual Offender Sentencing Alternative (SSOSA) if:
a. The court finds the defendant amenable to treatment and safe to be at large after a state licensed sexual offender treatment evaluation....
. . . .
c. If the SSOSA option is used, the State and the defendant shall stipulate to 48 months in prison suspended upon successful entry and completion of all phases of a state licensed sex offender treatment program....
. . . .

*264 e. The State would further recommend, if SSOSA is utilized, 180 days of local jail time....
f. The State reserves the right pursuant to RCW 9.94A.120(7)(E) to request a second SSOSA evaluation.
. . . .
i. After evaluation, should the defendant not be found by the Court to be safe at large or not amenable to treatment, the State and the defendant shall stipulate to 48 months in prison.[[1]]
On April 18, Kissee pled guilty to the four counts charged in cause number XX-X-XXXXX-X. During the plea proceeding, the prosecutor orally reiterated, "The State will agree he can seek S[S]OSA alternative with the conditions as set forth in paragraph 4a through i." The trial court responded, "Of course, if he's found not to be amenable to treatment or safe to be at large by the Court after an evaluation, letter i indicates that the defendant will be stipulating to 48 months."[2] The trial court accepted the pleas, dismissed cause number XX-X-XXXXX-X with prejudice, and ordered a SSOSA evaluation at public expense.
In truth, Kissee was not eligible for a SSOSA sentence. RCW 9.94A.120(8) provided, subject to certain conditions and exceptions not pertinent here, that the trial court could impose a SSOSA sentence "[w]hen an offender is convicted of a sex offense." RCW 9.94A.030(33) defined the term "sex offense" as follows:
(a) A felony that is a violation of chapter 9A.44 RCW or RCW 9A.64.020 or 9.68A.090 or a felony that is, under chapter 9A.28 RCW, a criminal attempt, criminal solicitation, or criminal conspiracy to commit such crimes;
(b) A felony with a finding of sexual motivation under RCW 9.94A.127 or 13.40.135; or
(c) Any federal or out-of-state conviction for an offense that under the laws of this state would be a felony classified as a sex offense under (a) of this subsection.
The three luring counts did not charge "sex offenses" within the meaning of this definition, because luring is a felony described in RCW 9A.40.090. The communicating count did not fall within this definition, because it charged a gross misdemeanor rather than a felony. Accordingly, the trial court lacked statutory authority to impose a SSOSA sentence.
Sometime after pleading, Kissee obtained new counsel and discovered his ineligibility for a SSOSA sentence. Thus, on June 9, 1995, he moved to withdraw his pleas of guilty. He argued, among other things, that he had been misinformed about his eligibility for a SSOSA sentence, and thus that his decision to plead guilty had not been knowing, voluntary and intelligent. The trial court denied his motion, and he was ultimately sentenced to 48 months of incarceration.[3]
Kissee now appeals the trial court's denial of his motion to withdraw his guilty pleas. Due process and CrR 4.2 require that a plea of guilty be entered knowingly, voluntarily and intelligently.[4] A plea is not knowing, voluntary or intelligent unless the defendant correctly understands its direct sentencing consequences.[5] A sentencing consequence is "direct" if it will have "a definite, immediate and largely automatic effect *265 on the range of the defendant's punishment."[6] A sentencing consequence is "indirect" or "collateral" if it "flows not from the guilty plea itself but from additional proceedings."[7]
In our view, one's eligibility for SSOSA is a direct sentencing consequence, because it "produces a definite, immediate and automatic effect on a defendant's range of punishment."[8] If eligibility exists, the trial court may impose community custody, up to three years of treatment, up to 180 days jail, and various other conditions.[9] If eligibility does not exist, the trial court generally must impose a sentence within the standard range, unless there are grounds for an exceptional sentence.
Here, it is obvious that Kissee was mistaken about his eligibility for SSOSA; indeed, the record demonstrates that his mistake was shared by the prosecutor, defense counsel, and the trial judge. Because of his mistake, he did not understand a direct sentencing consequence of his pleas, and his pleas were not knowing, voluntary and intelligent. He was entitled to withdraw his pleas, and the trial court erred by ruling otherwise.
The judgment is reversed, the guilty pleas are vacated, and the case is remanded for further proceedings.
BRIDGEWATER, Acting C.J., and SEINFELD, J., concur.
NOTES
[1]  Clerk's Papers at 25-26.
[2]  Report of Proceedings at 7.
[3]  The sentence was 12 months on each count, with all counts to run consecutively.
[4]  State v. Ross, 129 Wash.2d 279, 284, 916 P.2d 405 (1996); State v. Branch, 129 Wash.2d 635, 638-44, 919 P.2d 1228 (1996); State v. Ward, 123 Wash.2d 488, 512, 869 P.2d 1062 (1994); In re Montoya, 109 Wash.2d 270, 277, 744 P.2d 340 (1987); State v. Barton, 93 Wash.2d 301, 304, 609 P.2d 1353 (1980); State v. Taylor, 83 Wash.2d 594, 596, 521 P.2d 699 (1974); State v. Stowe, 71 Wash.App. 182, 186, 858 P.2d 267 (1993) (due process). If it is not, it generally must be set aside at the defendant's request. CrR 4.2(d), (f); Ross, 129 Wash.2d at 288, 916 P.2d 405; State v. Miller, 110 Wash.2d 528, 535, 536, 756 P.2d 122 (1988); Taylor, 83 Wash.2d at 597, 521 P.2d 699; State v. Moore, 75 Wash.App. 166, 173-74, 876 P.2d 959 (1994).
[5]  Ross, 129 Wash.2d at 284, 916 P.2d 405; Ward, 123 Wash.2d at 512, 869 P.2d 1062; Miller, 110 Wash.2d at 531, 756 P.2d 122; Wood v. Morris, 87 Wash.2d 501, 513-14, 554 P.2d 1032 (1976); Moore, 75 Wash.App. at 172-73, 876 P.2d 959.
[6]  Ross, 129 Wash.2d at 284, 916 P.2d 405 (quoting Barton, 93 Wash.2d at 305, 609 P.2d 1353); Ward, 123 Wash.2d at 512-13, 869 P.2d 1062; State v. Olivas, 122 Wash.2d 73, 96, 856 P.2d 1076 (1993).
[7]  Ross, 129 Wash.2d at 285, 916 P.2d 405; Ward, 123 Wash.2d at 513, 869 P.2d 1062; Barton, 93 Wash.2d at 305, 609 P.2d 1353.
[8]  Ross, 129 Wash.2d at 284, 916 P.2d 405.
[9]  RCW 9.94A.120(8)(a)(ii).
