
388 So.2d 168 (1980)
Robert T. WILLIAMSON
v.
STATE of Mississippi.
No. 52098.
Supreme Court of Mississippi.
September 24, 1980.
*169 W.S. Moore, Jackson, for appellant.
Bill Allain, Atty. Gen. by Carolyn B. Mills, Sp. Asst. Atty. Gen., Jackson, for appellee.
Before SUGG, BROOM and LEE, JJ.
LEE, Justice, for the Court:
Robert T. Williamson was convicted in the Circuit Court of Scott County for the sale of marijuana in a quantity greater than one (1) kilogram, and was sentenced to fifteen (15) years in the Mississippi State Penitentiary, said sentence to run consecutively with a previous sentence received by him in Rankin County, where he was sentenced to twenty-seven (27) years imprisonment with twenty-one (21) years suspended. Williamson has appealed and assigns two (2) errors in the trial below.

I.
The appellant first contends that the lower court erred in refusing to accept his plea of guilty.
Appellant attempted to plead guilty to the offense charged in the indictment. A hearing was held to determine whether or not the proposed plea was voluntary. The following transpired in the interrogation by the trial judge:
"Q. All right, now, do you still want to stand by your plea of guilty?
A. Yes, sir. Can I say something?
Q. Yes, sir.
A. I'm not guilty really. Those people, I never come to them and said I want to sell you some marijuana. They called me and I turned them down and they kept doing it. Finally I sold it to them. You would have sold it, too.
Q. I doubt it. I never have. I will not accept this Defendant's plea on the basis of his statement he is not guilty. He has raised to me an indication of a defense. I have a new jury coming in here Monday. I am setting this case for trial at 8:00 o'clock Monday. There will be no plea bargaining from this day forward. If the jury turns him loose, that is their responsibility. If the jury finds him guilty, then it is my responsibility for me to pass sentence. Remove him from the Courtroom, Sheriff."
Subsequently, prior to trial, counsel for appellant moved the court to accept the appellant's plea of guilty, and, in support thereof, argued that the remarks made by appellant at the sentencing hearing were taken out of context, were made only for the purpose of mitigating sentence, and were not intended to deny his guilt of the crime charged. In overruling the motion, the trial judge indicated that, at said hearing, appellant gave answers causing him to believe appellant was offering defenses *170 against the charge, and that he declined to accept the guilty plea for that reason.
In Santobello v. New York, 404 U.S. 257, 92 S.Ct. 495, 30 L.Ed.2d 427 (1971), the United States Supreme Court held that a criminal defendant has no absolute right to have his guilty plea accepted by a trial court, and that the trial judge may decline to accept such a plea in the exercise of sound judicial discretion.
The Fifth Circuit Court of Appeals has decided that a trial judge should not reject guilty pleas without good reason, where they are freely and voluntarily entered, and that good reason for rejecting the pleas could exist when there was a possibility of a later collateral attack on the judgments entered pursuant to such guilty pleas. United States v. Martinez, 486 F.2d 15 (5th Cir.1973). However, in North Carolina v. Alford, 400 U.S. 25, 91 S.Ct. 160, 27 L.Ed.2d 162 (1970), the United States Supreme Court held it is not error for a trial court to accept a plea of guilty in spite of a defendant's unwillingness, or inability, to admit guilt where compelling reasons exist for entering the plea when there exists substantial evidence of the defendant's guilt.
In the case sub judice, appellant denied his guilt, claimed the defense of entrapment, and his attorney attempted to develop that defense through cross-examination of the State's witnesses. We are of the opinion that the trial court did not abuse its discretion in declining to accept the guilty plea and that the first assignment is not well taken.

II.
Did the lower court err in imposing a greater sentence upon appellant than was offered in exchange for a guilty plea?
The trial judge stated, during pretrial hearing on the voluntariness of the proposed guilty plea, that the recommendations of the prosecution would be accepted and that appellant would be sentenced to serve a term of eight (8) years in the Mississippi State Penitentiary to run consecutively with a previous sentence given in Rankin County. Appellant now contends that imposition of the fifteen-year sentence was punishment against him for exercising his right to a trial by jury.
We held in Fermo v. State, 370 So.2d 930 (Miss. 1979), that, in sentencing a defendant, the trial court must consider only legitimate factors and cannot base the sentence of the accused, in whole or in part, on the exercise of his constitutional right to a jury trial.
In Frank v. Blackburn, 605 F.2d 910 (5th Cir.1979), the Court held that a defendant may not be more severely sentenced after conviction by a judge who earlier proposed a more lenient sentence in return for a plea of guilty to the same charge, unless there were reasons based upon the conduct of the defendant which were unknown to the trial judge when the lighter sentence was proposed.
In the present case, the record reflects that the trial judge, at the time the lighter sentence was discussed, was unaware that the defendant had committed an unindicted offense, viz, the sale of a controlled substance, Dilaudid. We are of the opinion that, when the trial judge took under consideration that fact, he did not abuse his discretion in imposing a greater sentence after the conviction of appellant.
There being no reversible error in the trial below, the judgment of the lower court is affirmed.
AFFIRMED.
SMITH and ROBERTSON, P. JJ., and SUGG, WALKER, BROOM, BOWLING and COFER, JJ., concur.
PATTERSON, C.J., took no part.
