
504 P.2d 1313 (1973)
Bobby Gene THOMAS, Appellant,
v.
SHERIFF, CLARK COUNTY, Nevada, Respondent.
No. 7010.
Supreme Court of Nevada.
January 12, 1973.
Morgan D. Harris, Public Defender, and Stewart L. Bell, Deputy Public Defender, Las Vegas, for appellant.
Robert List, Atty. Gen., Carson City, Ray A. Woofter, Dist. Atty., and Charles L. Garner, Chief Deputy Dist. Atty., Las Vegas, for respondent.

OPINION
BATJER, Justice:
Appellant, after a preliminary hearing, was ordered to stand trial on a felony charge of statutory rape. He was denied pre-trial habeas relief in the district court and appeals.
His only claim of error is that the state did not offer competent proof to establish his age. In a prosecution for statutory rape, proof of age of the accused is necessary to determine the grade of the offense and the penalty to be inflicted.[1]
*1314 Detective John Silbaugh, of the Clark County Sheriff's Office, testified that during his investigation of an unrelated crime that appellant stated that he [appellant] was "30 years of age." The prosecutor made no attempt to introduce independent evidence of the appellant's age.
In denying habeas relief the district judge stated: "[t]he reference to petitioner as a `man', by the Justice of the Peace and petitioner's counsel is sufficient corroboration of petitioner's extrajudicial admission that he was 30 years of age to establish the element of the age of the petitioner at the preliminary hearing." We need not determine if the statement of the trial court accurately reflects the law. The sole function of the preliminary hearing is to determine probable cause that the offense occurred and that the accused committed it. NRS 171.206. See Whittley v. Sheriff, 87 Nev. 614, 491 P.2d 1282 (1971).
Appellant erroneously relies on State v. Washington, 1 Or. App. 96, 458 P.2d 694, 459 P.2d 455 (1969), as authority to sustain his contention. Washington is distinguishable upon the ground that the reversal of a statutory rape conviction because the age of the victim, stated by the accused in a confession, was not corroborated.
"There is a presumption that a male person charged with ... rape is over 18 years of age. If a defendant, so charged, is under 18 years of age, such is relevant only on the question of punishment. Age is a matter of defense, and the burden of establishing this defense is on him." State v. Mitchell, 6 N.C. App. 534, 170 S.E.2d 355, 357 (1969); Brown v. State, 435 P.2d 173 (Okl.Cr. 1967); People v. Kutella, 269 N.E.2d 111 (Ill. App. 1971). Cf. Meaux v. State, 160 Tex.Cr.R. 121, 267 S.W.2d 833 (1954); Vickers v. Commonwealth, 472 S.W.2d 469 (Ky.App. 1971).
In McComas v. State, 75 Okl.Cr. 321, 131 P.2d 488 (1942), construing a statute similar to ours, the age of an accused in a rape case was held to be a matter of defense. Here, if the appellant, at trial, is able to establish that he was under 18 years of age at the time the offense was alleged to have been committed, that fact would be a conclusive defense to the charge. On the other hand, if the appellant is able to establish his age to be between 18 and 21 he could only be convicted of a gross misdemeanor. The accused's age is a question to be considered by the trier of fact, and neither the preliminary examination nor the hearing on the habeas petition is designed as a substitute for that function. Cf. State v. Fuchs, 78 Nev. 63, 368 P.2d 869 (1962).
Furthermore, appellant does not challenge the sufficiency of the evidence introduced at the preliminary examination to establish the fact that he had engaged in sexual intercourse with the victim, who was under the age of consent. The thrust of the appeal goes only to the sufficiency of the evidence to establish proof of his age. Respondent urges that for the purpose of establishing probable cause, under NRS 171.206, the proof offered, in the factual context of this case, was sufficient. We agree.
The order of the trial court is affirmed.
THOMPSON, C.J., and MOWBRAY, GUNDERSON and ZENOFF, JJ., concur.
NOTES
[1]  Under NRS 200.365 when "the male is of the age of 21 years or older" the offense is a felony. "Where the male is under the age of 21 years," the offense is a gross misdemeanor. If the male is under the age of 18 years there is no offense.
