
472 P.2d 345 (1970)
Bernell BRYANT, Appellant,
v.
SHERIFF, CLARK COUNTY, Nevada, Respondent.
No. 6255.
Supreme Court of Nevada.
July 15, 1970.
Charles L. Kellar, Las Vegas, for appellant.
Harvey Dickerson, Atty. Gen., Carson City, George E. Franklin, Jr., Dist. Atty., and Margie A. Richards, Deputy Dist. Atty., Las Vegas, for respondent.


*346 OPINION
PER CURIAM:
The appellant shot and killed one Bryant Cameron in the Brown Derby in Las Vegas on December 25, 1969. He was charged with murder in violation of NRS 200.010. On December 26, 1969, he surrendered himself to the Las Vegas Police Department voluntarily.
At the preliminary examination the evidence showed that the victim was shot four times, once in the back according to the state's pathologist, and that those shots caused the victim's death. It further showed that the shots were fired by the appellant, which fact he admitted during his testimony in his defense. The testimony was in direct conflict, however, on the issues of provocation and self-defense, some of the witnesses having seen a knife in the victim's hand and others neither having seen such a knife nor an argument between the victim and the appellant.
The testimony of the witnesses who could supply no facts concerning provocation or self-defense was that the appellant and the victim emerged through an entry-way and, without any conversation or altercation, the appellant commenced the shooting which resulted in the victim's death.
The testimony of the appellant, and his witnesses who saw the knife in the victim's hand, was that the victim approached the appellant with the knife, whereupon the appellant disclaimed any desire to fight but was forced to struggle to avoid the knife. During the scuffle someone handed the appellant the pistol and he shot the victim, repeatedly because the first shots did not stop him.
On the proof adduced at the preliminary examination the appellant was bound over for trial on the murder charge, but he was released on bail pending the trial. He then petitioned for habeas corpus and this appeal is from the order of the district court denying habeas.
The thrust of the appellant's pre-trial habeas petition, and his principal contention on appeal, is that the evidence was insufficient to constitute probable cause to hold him for trial on the offense charged.
However, even on a murder charge the quantum of proof necessary in order to hold an accused to answer in the district court is only that it appear to the magistrate, from substantial and competent evidence, that an offense has been committed and that the defendant committed it. When the evidence is in conflict at the preliminary examination it is the function of the magistrate to determine the weight to be accorded the testimony of the witnesses, and so long as an inference of criminal agency can be drawn from the evidence it is proper for the magistrate to draw it, thereby leaving to the jury at the trial the ultimate determination of which of the witnesses are more credible. Miner v. Lamb, 86 Nev. ___, 464 P.2d 451 (1970). Hanley v. State, 85 Nev. 154, 451 P.2d 852 (1969).
Upon the trial of this cause the evidence that the appellant presents in his defense may be sufficiently persuasive to result in a conviction on a lesser charge, or even acquittal. However, the accused's explanation for the homicide, being in the nature of a defense, whether true or false, reasonable or unreasonable, is for the trier of fact to consider at the trial, and neither the preliminary examination nor the hearing on the habeas petition is designed as a substitute for that function. State v. Fuchs, 78 Nev. 63, 368 P.2d 869 (1962).
On the record of the preliminary examination there is sufficient competent evidence to make it appear that the crime of murder had been committed and there is probable cause to believe that the appellant committed it. In re Ervin, 76 Nev. 297, 352 P.2d 718 (1960).
Consequently, the order of the district court denying the appellant's petition for a writ of habeas corpus is affirmed.
