
666 P.2d 123 (1983)
PEOPLE of the State of Colorado, Plaintiff-Appellant,
v.
Leroy C. GONZALES, Defendant-Appellee.
No. 82SA18.
Supreme Court of Colorado, En Banc.
June 27, 1983.
Rehearing Denied July 18, 1983.
*124 Dennis E. Faulk, Dist. Atty., Canon City, Steven B. Rich, Deputy Dist. Atty., Fairplay, for plaintiff-appellant.
J. Gregory Walta, Colorado State Public Defender, Charles F. Kaiser, Deputy State Public Defender, Diana L. DeGette, Deputy State Public Defender, Denver, for defendant-appellee.
NEIGHBORS, Justice.
The People appeal the district court's order granting judgment of acquittal at the close of all the evidence.[1] We conclude that the ruling was erroneous and disapprove the judgment entered by the trial court.[2]

I.
The defendant was charged in the Fremont County District Court with possession of contraband[3] (a homemade knife), and two counts of habitual criminality.[4] The *125 substantive charge arose out of an altercation between the defendant and a fellow inmate which occurred in the Centennial Correctional Facility on May 21, 1981. The prosecution's theory was that the circumstantial evidence established that the defendant was armed with a knife during the incident.
The parties stipulated that the defendant was confined in a detention facility on May 21, 1981. The evidence presented to the jury established that the defendant and Ronald Montgomery, the fellow inmate, were first observed to be arguing by Corrections Officer Richard Yokom who was in the control center of Unit D. He saw the defendant and Montgomery engaged in a "low-key argument" on the upper tier of the pod, near the door to Montgomery's cell. Yokom testified that the discussion terminated and both men walked to the stairs leading to the lower tier of cells. They proceeded "part way down the stairs" when further words were exchanged. Montgomery immediately returned to his cell where he seized a mop handle which he shook at the defendant. The defendant went downstairs to the lower tier, towards cells 5 through 8, which were out of Yokom's sight. The defendant was housed in Cell No. 6. There is a dispute in the testimony as to whether the defendant's cell door might have been open. Corrections Technician Johnny Rodriguez testified to the policy in effect on May 21, 1981. He said that an inmate could request that his cell door be left open for certain periods of time. However, Yokom stated that the defendant's cell door was locked. In any event, the defendant returned to the upper tier where he and Montgomery had been arguing. The defendant and Montgomery then began fighting. Yokom sent Rodriguez to investigate. Rodriguez testified that he saw something "kind of shiny" in the defendant's right hand and that the object "appeared to be a knife." Rodriguez told the defendant and Montgomery to quit fighting but they ignored his order. Rodriguez observed the fight from a distance of ten to twelve feet for a period of possibly six to ten seconds. When the parties refused to stop fighting, Rodriguez yelled at Yokom to "send more help." Yokom heard a knife hit the floor. Yokom testified that the knife fell "two or three, four at the most," feet from the participants during the scuffle. The fight took place in front of cell 3 or 4 but the parties were closer to the railing than to the cells.
After asking Yokom to send reinforcements, Rodriguez went up the stairs to the second tier where he saw a knife on the floor. The knife was three or four feet away from where the participants were fighting. Rodriguez seized the knife and later placed it in the evidence locker. When other corrections officers, armed with guns, appeared on the scene, the defendant and Montgomery quit fighting and were returned to their respective cells.
Neither Rodriguez nor Yokom saw where the knife came from. Rodriguez identified the knife offered into evidence as the one he found, but stated that the object he saw in the defendant's hand "didn't look this big." He further testified that the front part of the knife was "shiny." On cross-examination, Rodriguez admitted making the following statement to the investigator for the attorneys who represented the defendant: "I have to say it was a knife now because that's what I picked up, but I couldn't tell at that time."
Rodriguez testified that the defendant's right hand was wrapped with an Ace bandage. He also stated that he watched the nurse examine the defendant's right hand after the fight and was "absolutely sure" there was no cast on the hand at that time.
The trial court denied the defendant's motion for judgment of acquittal made at the close of the prosecution's evidence. The court found that a prima facie case had been established.
The defendant then called three witnesses to refute the prosecution's evidence. Montgomery, the co-participant in the altercation, testified that the defendant did not have a knife in his possession. Montgomery said the knife was thrown through the tray slot from a cell door in the upper *126 tier, ten to fifteen feet from where he and the defendant were fighting. Montgomery stated that he heard the knife hit the tray slot as it was thrown through a cell door when the "goon squad" (the corrections officers requested by Rodriguez) appeared. When he saw the knife, Montgomery kicked it towards the stairs to prevent the defendant from using it. Montgomery also testified that the defendant had a cast on his right hand.
Robert Lee Romero, a prisoner at the facility, also testified as a defense witness. Romero was an eyewitness to the fight, which occurred in front of his cell. He stated he was three to four feet from the fight. He saw a bandage on the defendant's thumb. Romero said that the knife came from someplace to his left, slid across the floor, and ended up between the defendant and Montgomery. He stated he never saw the defendant in possession of a knife at any time. He testified that Montgomery picked up the knife "and threw it outside the door."
The defense then called Jackie Hendrickson, a nurse-practitioner at the Centennial Correctional Facility. She testified that a week earlier the defendant had suffered a chip fracture of the second joint of his thumb, that a physician's assistant had applied a plaster of paris cast to the defendant's right thumb, and that the cast had been wrapped in an Ace bandage. Ms. Hendrickson testified that the cast and Ace bandage were in place after the fight on May 21, 1981. She gave her opinion that it would be "very, very doubtful" the defendant could grip an object in his right hand. However, she admitted she had not seen the defendant attempt to hold anything with his right hand.
The trial judge entered a judgment of acquittal on his own motion after the defendant completed his evidence and the district attorney informed the court he had no rebuttal evidence. The trial judge made three significant findings of fact and conclusions of law. He found that the case against the defendant was based almost entirely on circumstantial evidence. The judge further found that the testimony of Ms. Hendrickson "shows to the court that the defendant could not have grasped a knife with his right hand." He concluded that "there is no evidence in the record from which a jury can find beyond a reasonable doubt that the circumstances are such as to exclude every reasonable hypothesis of innocence."
The People then filed this appeal.

II.
The threshold inquiry is whether this appeal by the district attorney, filed pursuant to section 16-12-102, C.R.S.1973 (1978 Repl.Vol. 8), involves issues appropriate for review by this court. The issue of sufficiency of the evidence involves a question of law, and, as such, the district attorney is granted the statutory authority to appeal. People v. Kirkland, 174 Colo. 362, 483 P.2d 1349 (1971). The purpose of appellate review in cases filed by the prosecutor involving sufficiency of the evidence is twofold: "(1) to settle the controversy, and (2) to provide explanation of and to give clarity to questions of law by means of published opinions." People v. Kirkland, 174 Colo. at 364, 483 P.2d at 1350. Both prongs of the Kirkland test are met here. The trial court clearly applied an erroneous legal standard in granting the judgment of acquittal. In addition, there is a substantial question involving the sufficiency of the evidence created by the trial judge's ruling denying the defendant's motion for judgment of acquittal made at the close of the prosecution's evidence and then granting judgment of acquittal on his own motion after the defendant presented his evidence. Accordingly, we elect to address the merits of this case.

III.
The trial court erroneously applied the test set forth in People v. Naranjo, 181 Colo. 273, 509 P.2d 1235 (1973), when it granted judgment of acquittal. In Naranjo, this court adhered to the test enunciated in Mathis v. People, 167 Colo. 504, 448 P.2d 633 (1968). We held in Mathis that where *127 the guilt of the defendant is established by circumstantial evidence, the test to be used in considering motions for judgment of acquittal is whether there is evidence in the record from which a jury can find beyond a reasonable doubt that the circumstances are such as to exclude every reasonable hypothesis of innocence.
The "reasonable hypothesis of innocence" test was abandoned nearly ten years ago in favor of a more appropriate standard in People v. Bennett, 183 Colo. 125, 515 P.2d 466 (1973). In Bennett we held that in ruling on a motion for judgment of acquittal, the trial court
"must determine whether the evidence before the jury is sufficient in both quantity and quality to submit the issue of the defendant's guilt or innocence to the jury.
....
"The issue before the trial judge is whether the relevant evidence, both direct and circumstantial, when viewed as a whole and in the light most favorable to the prosecution, is substantial and sufficient to support a conclusion by a reasonable mind that the defendant is guilty of the charge beyond a reasonable doubt."
183 Colo. at 129-30. The Colorado appellate courts have continued to apply the substantial evidence test. See, e.g., People v. Brassfield, 652 P.2d 588 (Colo.1982); People v. Franklin, 645 P.2d 1 (Colo.1982); People v. Ganatta, supra; People v. Fierro, 199 Colo. 215, 606 P.2d 1291 (1980); People v. Downer, 192 Colo. 264, 557 P.2d 835 (1976); People v. Gomez, 189 Colo. 91, 537 P.2d 297 (1975); People v. Gordon, 44 Colo.App. 266, 615 P.2d 62 (1980).

IV.
The Bennett test is constitutionally mandated by due process requirements of the United States and Colorado Constitutions. The due process clause of the United States Constitution prohibits the criminal conviction of any person except on proof of guilt beyond a reasonable doubt. In re Winship, 397 U.S. 358, 90 S.Ct. 1068, 25 L.Ed.2d 368 (1970); People v. Hardin, 199 Colo. 229, 607 P.2d 1291 (1980). In Jackson v. Virginia, 443 U.S. 307, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979), the Supreme Court reaffirmed its decision in Winship and stated:
"In short, Winship presupposes as an essential of the due process guaranteed by the Fourteenth Amendment that no person shall be made to suffer the onus of a criminal conviction except upon sufficient proofdefined as evidence necessary to convince a trier of fact beyond a reasonable doubt of the existence of every element of the offense."
443 U.S. at 316, 99 S.Ct. at 2787. The relevant question is whether, after viewing the evidence in the light most favorable to the prosecution, any rational trier of fact could find that each of the essential elements of the crime charged has been proven beyond a reasonable doubt. Jackson v. Virginia, supra.

A.
When ruling on a motion for judgment of acquittal, the court must consider both the prosecution and the defense evidence. People v. Urso, 129 Colo. 292, 269 P.2d 709 (1954); United States v. Fearn, 589 F.2d 1316 (7th Cir.1978); Cephus v. United States, 324 F.2d 893 (D.C.Cir.1963); United States v. Gasomiser, 7 F.R.D. 712 (D.C.Del.1947). When the defendant offers evidence at trial, the correctness of the ruling on a judgment of acquittal is determined from the state of the evidence at the end of the trial. People v. Olinger, 180 Colo. 58, 502 P.2d 79 (1972); Silcott v. People, 176 Colo. 442, 492 P.2d 70 (1971); Tucker v. People, 136 Colo. 581, 319 P.2d 983 (1957).[5]
In determining whether a reasonable-minded jury might accept the evidence, taken in the light most favorable to the prosecution, as substantial and sufficient *128 to support a finding of the accused's guilt beyond a reasonable doubt, the trial court is necessarily required to weigh the evidence. In performing this function, the trial court is bound by well-established principles of law which we now summarize: First, the court must give the prosecution the benefit of every reasonable inference which might be fairly drawn from the evidence. People v. Downer, supra. However, "[i]t is essential ... that there be a logical and convincing connection between the facts established and the conclusion inferred." United States v. Bycer, 593 F.2d 549, 550 (3rd Cir.1979). Second, the determination of the credibility of witnesses is solely within the province of the jury. People v. Franklin, supra; People v. Noga, 196 Colo. 478, 586 P.2d 1002 (1978). "Only when a witness' testimony is `palpably incredible and ... totally unbelievable' may the court properly reject it as a matter of law." People v. Brassfield, 652 P.2d at 592 (quoting People v. Franklin, 645 P.2d at 4). Even under this circumstance, a judgment of acquittal would be inappropriate if the remaining evidence is legally sufficient to support a finding of guilt beyond a reasonable doubt. People v. Franklin, supra. Third, the trial court may not serve as a thirteenth juror and determine what specific weight should be accorded to various segments of the evidence by resolving conflicts in the evidence. People v. Downer, supra; People v. Noga, supra. Fourth, a "modicum" of relevant evidence will not rationally support a conviction beyond a reasonable doubt. Jackson v. Virginia, supra. Fifth, verdicts in criminal cases may not be based on "guessing, speculation or conjecture." People v. Urso, 129 Colo. at 297, 269 P.2d 709.
On occasion, we have reiterated the rule that once a prima facie case is established, it is impregnable to a motion for judgment of acquittal. People v. Ganatta, supra; People v. Chavez, 182 Colo. 216, 511 P.2d 883 (1973); People v. Rivera, 37 Colo. App. 4, 542 P.2d 90 (1975). This is but another way of stating that after considering the quantity and quality of all the evidence, there is substantial relevant evidence in the record from which a fair-minded jury could find that the guilt of the accused has been established beyond a reasonable doubt with regard to each essential element of the crime. See United States v. Barfield, 447 F.2d 85 (5th Cir.1971).

B.
We now turn to the application of the Bennett test to the evidence in this case.
On May 21, 1981, the elements of possession of contraband enumerated in section 18-8-204.1, C.R.S.1973 (1978 Repl.Vol. 8 & 1981 Supp.), were: (1) the defendant, (2) being confined in a detention facility, (3) knowingly, (4)(a) obtains or (b) has in his possession, (5) contraband (a homemade knife).
There was evidence that the defendant possessed a knife based on Rodriguez' testimony that he saw something "shiny" in the defendant's hand and that the object looked like a knife. A knife was retrieved by Rodriguez in close physical proximity to the place where the defendant was fighting. Direct evidence that the defendant did not have a knife during the fight was presented through inmates Montgomery and Romero. There was also a conflict in the evidence relating to the issue of whether the defendant's right hand was in a cast. Rodriguez testified that the defendant's right hand was only wrapped in an Ace bandage and that he was positive there was no cast on it. Hendrickson testified that there was a cast on his hand.
The trial court improperly invaded the province of the jury in finding "that the defendant could not have grasped a knife with his right hand." When there is conflicting evidence, the trial judge must permit the jury to perform its historic fact-finding function. United States v. Beck, 615 F.2d 441 (7th Cir.1980). We note that a permissible inference favorable to the prosecution, to which it is entitled, may be drawn from Hendrickson's testimony that the defendant would have extreme difficulty in grasping an object. This testimony is consistent with the prosecution's theory *129 that the defendant dropped the knife during the altercation.
We are satisfied that there is substantial and sufficient evidence in the record from which a reasonable-minded jury might find that the defendant's guilt on the charge of possession of contraband had been proven beyond a reasonable doubt. We disapprove the order of the trial court granting the defendant a judgment of acquittal.
NOTES
[1]  Crim.P. 29 provides in pertinent part:

"The court on motion of a defendant or of its own motion shall order the entry of a judgment of acquittal of one or more offenses charged in the indictment or information ... after the evidence on either side is closed, if the evidence is insufficient to sustain a conviction of such offense or offenses."
[2]  Where a judgment of acquittal is entered at the close of the evidence, the constitutional prohibition against double jeopardy forbids retrial of the defendant, even though the trial court erred as a matter of law in granting the judgment of acquittal. See People v. Ganatta, 638 P.2d 268 (Colo.1981); People v. Quintana, 634 P.2d 413 (Colo.1981); People v. Paulsen, 198 Colo. 458, 601 P.2d 634 (1979); U.S. Const. amend. V; Colo. Const. art. II, sec. 18.
[3]  Section 18-8-204.1, C.R.S.1973 (1978 Repl. Vol. 8 & 1981 Supp.).
[4]  Section 16-13-101, C.R.S.1973 (1978 Repl. Vol. 8 & 1980 Supp.).
[5]  The question of what analysis is appropriate when the defendant presents evidence of an affirmative defense is not presented in this case. Therefore, we leave to another day resolution of the issues involving motions for judgment of acquittal when the defendant presents evidence of an affirmative defense and the prosecution offers no rebuttal evidence.
