
482 P.2d 289 (1971)
Thomas William WRENN, Appellant,
v.
SHERIFF, CLARK COUNTY, Nevada, Respondent.
No. 6378.
Supreme Court of Nevada.
February 26, 1971.
*290 George E. Holt, Earl & Earl, Las Vegas, for appellant.
Robert List, Atty. Gen., Carson City, Roy Woofter, Dist. Atty., and Charles L. Garner, Deputy Dist. Atty., Las Vegas, for respondent.

OPINION
PER CURIAM:
The appellant was charged with open murder in violation of NRS 200.010. After a preliminary examination he was bound over to the district court for trial. His petition for a writ of habeas corpus was denied, and he appeals.
The principal contention of the appellant is that the evidence at the preliminary examination was insufficient to show that a first degree murder had been committed because there was no direct proof of malice aforethought, and thus the evidence adduced was less than sufficient to constitute probable cause to hold the appellant on an open murder charge. We reject that contention and affirm the order of the district court denying habeas corpus.
The appellant argues that there is no evidence that he intentionally fired the shot which killed the victim of the shooting; he asserts that the gun was fired accidentally, and that thus there was no malice aforethought. However, the appellant testified that he thought the victim had a gun, and that is why he got a weapon himself. Another witness testified that the victim had fired a pistol just prior to the fatal shooting. The evidence which was not in conflict showed that the appellant first sought to confront the victim with a pistol, but when he found it unloaded he went for and obtained a rifle. There is no conflict in the evidence showing that the victim fled after the appellant fired two shots from the rifle. The third shot from the rifle was fatal to the victim and, while there is conflicting evidence as to how that shot happened to be fired, the appellant had possession of the weapon at the time.
The magistrate resolved the conflicts in the evidence, and found that the proof adduced at the preliminary examination was sufficient to show that the crime of murder had been committed and that there was probable cause to believe that the appellant committed it. Goldsmith v. Sheriff, 85 Nev. 295, 454 P.2d 86 (1969).
When the evidence is in conflict at the preliminary examination it is the function of the magistrate to determine the weight to be accorded to the testimony of the witnesses, and if 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. *291 Lamb, 86 Nev. 54, 464 P.2d 451 (1970); Bryant v. Sheriff, 86 Nev. 622, 472 P.2d 345 (1970). 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 trial; and neither the preliminary examination nor the hearing upon a petition for habeas corpus is designed as a substitute for that function. Bryant v. Sheriff, supra; State v. Fuchs, 78 Nev. 63, 368 P.2d 869 (1962).
We have held previously that an open murder complaint charges murder in the first degree and all necessarily included offenses, such as manslaughter where less than all the elements of first degree murder are present. Miner v. Lamb, supra; Parsons v. State, 74 Nev. 302, 329 P.2d 1070 (1958); State v. Oschoa, 49 Nev. 194, 242 P.2d 582 (1926); N.R.S. 175.501. Thus there is no merit to the appellant's contention that unless there is some direct and substantial proof of malice aforethought at the preliminary examination, an accused cannot be held on an open murder charge.
On the record of the preliminary examination before us there was sufficient competent evidence to make it appear that the crime of murder had been committed, and there was probable cause to believe that the appellant committed it. In re Ervin, 76 Nev. 297, 352 P.2d 718 (1960).
Affirmed.
