We grant certiorari to determine the correctness of a trial court ruling finding defendant, Alfred Smith, not guilty of being a habitual offender.
On May 11, 1990 defendant, Alfred Smith, pled guilty as charged to two counts of first degree robbery and one count of armed robbery. The State subsequently filed a bill of information charging defendant as a habitual offender. On June 12, 1990 the trial court found defendant not guilty of being a habitual offender. The State did not seek review of the trial court’s ruling, rather, on October 9, 1990, it filed another information charging defendant as a habitual offender. The trial court found that it had no jurisdiction to entertain the second habitual offender information after defendant had been found not guilty on the first information.1 The court gave the State the opportunity to seek a writ with regard to the trial court’s ruling on the first habitual offender information.
Defendant’s plea of guilty form contains the notation:
[Ejither no bill or judge will find not guilty on bill.
The notation reflects an “ex parte” plea agreement between the trial court, defendant, and defendant’s counsel, that, either the State would not file a habitual offender information or, if it did, the court would find defendant not guilty of being a habitual offender. The State was not a party to this plea agreement.
At the habitual offender hearing on the first information, the trial court found defendant not guilty without regard to the evidence presented by the State, solely to *434fulfill the terms of the ex parte plea agreement.2 The trial court had no authority to find defendant not guilty on the original habitual offender information pursuant to such an ex parte plea agreement. State v. McFarland, 578 So.2d 1014 (La.App. 4th Cir.1991). A trial court has no discretion to find a defendant not guilty of being an habitual offender unless the State fails to meet its burden of establishing that status. See State v. Dean, 588 So.2d 708 (La.App. 4th Cir.1991), writ denied, 595 So.2d 652 (La.1992). Therefore, the trial court erred in finding defendant not guilty of being habitual offender.
Even if there was no lawful plea agreement with the concurrence of the State, if defendant justifiably believed there was, and pled guilty in part because of that belief, the guilty plea was not knowingly made. In such a case, the plea must be set aside and defendant allowed to plead anew. State v. McFarland, supra. See also, State v. Hayes, 423 So.2d 1111 (La.1982); State ex rel. Lafleur v. Donnelly, 416 So.2d 82 (La.1982).
For the foregoing reasons, we vacate and set aside defendant’s conviction (his plea of guilty) and sentence, and remand this case for further proceedings consistent with the views expressed herein.
WRIT GRANTED; VACATED AND REMANDED.
. The judgment of not guilty on the first habitual offender information was rendered by Judge Pro Tempore George Perez, sitting temporarily in Section "E" of Criminal District Court. The trial judge who entertained the State’s second habitual offender information was Judge Calvin Johnson, recently elected to fill the seat in Section "E.”
. The trial court gave no reasons for finding defendant not guilty. However, defendant's counsel, who represented defendant at all times pertinent to this writ application, and who signed his name to the ex parte plea agreement, implicitly admitted at the second habitual offender hearing that the ruling at the first hearing was based solely on the ex parte plea agreement. Addressing the bench he stated:
What the state is doing is, in essence, what they’re saying is is [sic] everytime [sic] the Court finds someone not guilty on a Bill, they’re going to refile a Bill. And the Court’s going to find, if there was an agreement made between the Court and the defendant concerning a Bill, and part of the plea was that the judge was going to find him either not guilty on the Bill or no Bill was going to be filed, then the state’s going to keep bringing Bills back.