Lawrence Miles appeals from the district court’s order denying his petition for a writ *639of habeas corpus pursuant to 28 U.S.C. § 2254. He had been charged in Nebraska state court with breaking and entering, in violation of Neb.Rev.Stat. § 28-532. While appellant was in custody, his attorney negotiated a plea agreement with the county attorney. The substance of the agreement was that, in return for appellant pleading guilty to the breaking and entering charge, the county attorney would not file habitual criminal charges against appellant and would recommend to the trial judge that appellant be sentenced to no more than 18 months imprisonment. Appellant accepted this agreement, and signed an affidavit to this effect. The affidavit recited that the agreement was not binding on the court.
At his arraignment, appellant pleaded guilty. The judge inquired about the existence of a plea agreement and appellant and his attorney recited the substance of the agreement. The judge thereupon informed appellant that the court was not bound by any plea agreement, and asked if appellant, knowing the court was not bound thereby, still wished to plead guilty. The appellant answered affirmatively. Thereafter, appellant did not move to withdraw his plea.
Approximately three weeks after arraignment, the court sentenced appellant to a term of two to four years imprisonment. Appellant did not appeal the conviction,1 but thereafter filed a motion for post-conviction relief in state court. His motion alleged, inter alia, that the trial court erred in failing to honor the plea agreement. The motion was denied and the denial affirmed by the Supreme Court of Nebraska. State v. Miles, 194 Neb. 128, 230 N.W.2d 227 (1975). Appellant thereupon filed the instant petition for a writ of habeas corpus. After a hearing, the district court entered an order denying appellant’s petition and this appeal ensued.
On appeal, appellant contends that the state trial court should be bound by a plea agreement or, in the alternative, that the court is required to indicate to the defendant its rejection of the terms of the plea agreement and afford the defendant an opportunity to withdraw his plea before sentence is pronounced.
In support of his first contention appellant suggests that this holding is a logical extension of the Supreme Court’s decision in Santobello v. New York, 404 U.S. 257, 92 S.Ct. 495, 30 L.Ed.2d 427 (1971), that a prosecutor who has negotiated a plea agreement with a defendant must abide by that agreement if the defendant pleads guilty.2 Suffice it to say that the Santobello opinion specifically says that a court may reject such a plea. Id. at 262, 92 S.Ct. 495. See also Bouchillon v. Estelle, 507 F.2d 622, 623 (5th Cir. 1975).
Alternatively, appellant contends that if a state trial court rejects the terms of a plea agreement, it must so inform the defendant and allow him an opportunity to withdraw his plea before sentence is pronounced. It should be noted that appellant does not base this proposition on the ground that his plea was involuntary although the district court’s hearing was largely devoted to determining whether appellant pleaded guilty under the mistaken impression, induced by his counsel, that the trial judge was a party to the plea agreement. If this were the case, a colorable claim of involuntariness would arise. However, the evidence adduced at the hearing indicates that appellant knew that the court was not legally bound by the plea agreement, and that appellant merely believed that the court would probably go along. Such a subjective belief that a lenient sentence will be imposed, even if based on an erroneous estimate by defense counsel, does not render a plea involuntary. See, e. g., Masciola *640v. United States, 469 F.2d 1057, 1059 (3d Cir. 1972); United States v. Battle, 467 F.2d 569, 570 (5th Cir. 1972).
The judgment of the trial court is affirmed.
. Nebraska allows appeals from a conviction obtained pursuant to a plea of guilty. See Stanosheck v. State, 168 Neb. 43, 95 N.W.2d 197 (1959). Appellant alleges that he did not appeal out of fear that the county attorney would file habitual criminal charges against him if he prosecuted an appeal.
. Appellant concedes that the county attorney in the instant case fully complied with the terms of the plea agreement.