After a jury trial in Superior Court (York County) Robert Dumont was convicted of unlawful sexual contact, 17-A M.R.S.A. § 255(1)(C) (1983), and sentenced to three years in the Maine State Prison, with one and one-half years suspended. On appeal, he challenges the legality of the sentence, arguing that the sentencing justice deprived him of due process and the right to confrontation by considering and relying on two affidavits in the course of the sentencing proceeding. We find no error and deny the appeal.
I.
On June 4, 1984, the defendant was indicted for a single incident of unlawful sexual contact, 17-A M.R.S.A. § 255(1)(C). On December 18, 1984, after a jury trial, the defendant was found guilty of the crime charged. The central issue at trial was whether the incident occurred. The nine year-old prosecutrix testified that while attending a cook-out, the defendant, a family friend, put his hands inside her shorts and felt her “private parts.” The defendant denied ever having touched the child.
On February 13, 1985, the court conducted a sentencing hearing at which the defendant and his counsel were’ present. The State offered three affidavits to establish aggravating circumstances in support of its sentencing recommendation. The State had provided copies of the affidavits to the defendant at some time before offering them to the sentencing justice. The defendant objected to the justice’s consideration of the affidavits, stating:
The Defense certainly would agree with the proposition that it’s important for the Court to inquire into the characteristics of the Defendant. However, the Defense is prepared to produce witnesses *165that are here. Ready, willing and able to testify which the State is certainly able to cross-examine on her own instance. We know of no way to cross-examine affidavits. They are clearly hearsay evidence. We have no independent evidence of their reliability or authenticity and we have no way of cross-examining those affidavits.
We strongly object to the introduction of these and on that basis and further on the basis that two of these affidavits deal with allegations that have no relevance whatsoever to these particular proceedings. So the Defendant strongly does object and request that the Court rule these affidavits inadmissible.
The justice admitted two of the three affidavits, one by the prosecutrix and the other by an fourteen-year-old girl who had testified at trial. These affidavits stated that the defendant had on other occasions engaged in conduct similar to that for which he had been convicted. It is not disputed that the sentencing justice treated the affidavits as true and that they influenced his sentencing decision.
The sentencing justice addressed the defendant as follows:
Mitigating circumstances in your case are that you are a good family man, apparently, and have a nice family and very supportive family and that is to your credit. In addition, your public service. The service to your community is to your credit. And I give you credit for that.
The aggravating circumstances are the severity of the particular crime itself. First of all, the child was quite young and any time that you — a Defendant picks on a young child, that alone justifies serious punishment. Because the young child is basically defenseless and simply not equipped to handle the assault of an adult. Also the particular act you were convicted of is not the most serious unlawful sexual contact we have run across — we run across a great deal of this in this Court and as serious as it is, it is not as bad as many that we see.
However, I noticed from the affidavit of [the prosecutrix] that this is not a one-time offense. This has happened according to her affidavit over a period of years beginning when she was six years old and going on until the spring of 1984. So in other words, this was not a onetime spur of the moment unthinking act. It’s a calculated act. It’s a repeated act, and that makes it serious.
In addition, the other affidavit that I have allowed into evidence for sentencing purposes suggests to me that [the prosecutrix] was not the only victim of your unlawful or illegal advances. So that is a serious aggravating circumstance. The other aggravating circumstance is your lack of remorse. I realize you claim that you’re innocent, but we had a jury here of twelve people who listened very carefully to the victim and listened very carefully to you and the only inference to be drawn from their verdict is that they were convinced that you were lying....
I weighed the mitigating circumstances and the aggravating circumstances that I’ve heard defined here and I think the aggravating circumstances somewhat outweigh the mitigating circumstances.
Therefore, I’m going to give you a prison term....
He then imposed a three year sentence with one and one-half years suspended.1
II.
Before discussing the merits, we note that the claimed illegality in the sen*166tencing process may be raised on direct appeal. Defendant’s challenge is based on the fact that the sentencing justice took into account hearsay information contained in two affidavits, in violation of his constitutional rights to confrontation and due process. As such, it constitutes an attack on the legality of the sentencing proceeding and is cognizable on direct appeal. See State v. Farnham, 479 A.2d 887, 889 (Me.1984) (claim that sentencing justice increased the sentence imposed because defendant exercised his constitutional right to stand trial considered on direct appeal); State v. Palmer, 468 A.2d 985, 987 (Me.1983) (challenge to sentence on constitutional grounds held cognizable on direct appeal). In addition, “the alleged infirmity, even if one of law, must appear affirmatively from the record.” State v. Farnham, 479 A.2d at 889 (quotations omitted). Since the sentencing justice’s consideration of, and reliance on, the two affidavits appear in the record, the legality of the manner in which the sentence was imposed is properly before the court on direct appeal.
III.
The defendant argues essentially that due process requires that persons making allegations of unlawful conduct be subject to cross-examination where those allegations are offered by the State to enhance punishment.
Factual information regarding the defendant’s criminal conduct for which he has not been charged may be considered by a sentencing justice in order to obtain a complete and accurate picture of the person to be sentenced. Williams v. New York, 337 U.S. 241, 247, 69 S.Ct. 1079, 1083, 93 L.Ed. 1337 (1948); United States v. Johnson, 767 F.2d 1259, 1276 (8th Cir.1985). Due process requires, however, that such information be factually reliable. Townsend v. Burke, 334 U.S. 736, 741, 68 S.Ct. 1252, 1255, 92 L.Ed. 1690 (1948); United States v. Baylin, 696 F.2d 1030, 1039-40 (3d Cir.1982).
Factual reliability is assured in various ways. Information marshalled by a probation officer in a pre-sentence report is presumed to be reliable because that officer is a neutral professional who “[has] not been trained to prosecute but to aid offenders.” Williams v. New York, 337 U.S. at 249, 69 S.Ct. at 1084; see also Haller v. Robbins, 409 F.2d 857, 859 (1st Cir.1969). Nevertheless, due process requires that the defendant be afforded a timely examination of the report and an opportunity to dispute any facts contained therein. See State v. Hardy, 489 A.2d 508, 512 (Me.1985); see also United States v. Read, 534 F.2d 858, 859-60 (9th Cir.1976) (sentence vacated when trial court relied on allegations of defendant’s involvement in “criminal activity of a severe kind” but failed to afford the defendant opportunity to explain or refute the information); F.R.Crim.P. 32(c)(3). See generally ABA Standards for Criminal Justice Standards 18-5.4(a) (1980) (“Fundamental fairness ... requires” broad disclosure of all derogatory information “in a form sufficient to give an adequate opportunity for rebuttal.”).
A sentencing justice is not limited to considering information contained in a pre-sentence report. Frequently, information is derived from first hand observation of the defendant by the sentencing justice obtained as a result of the trial process. See United States v. Grayson, 438 U.S. 41, 50-51, 98 S.Ct. 2610, 2615-2616, 57 L.Ed.2d 582 (1978) (permissible for sentencing judge, in fixing sentence, to give consideration to defendant’s false testimony at trial); State v. Farnham, 479 A.2d at 891-92 (permissible for sentencing justice to give consideration to defendant’s “whole course of conduct” at trial); State v. O’Donnell, 495 A.2d 798, 803 (Me.1985) (permissible for sentencing justice to consider trial evidence of unlawful conduct by defendant for which he has not been charged); see also State v. Pullen, 266 A.2d 222, 230 (Me.1970). Such information obtained through the trial process is factually reliable because it is derived from sworn testimony of *167witnesses subject to cross-examination and observation by the court.
When allegations of unlawful conduct of the defendant for which he has not been charged come before the court from sources other than a pre-sentence report or the trial process, the sentencing justice has broad discretion to determine what procedure, if any, is necessary to ensure that the allegations are factually reliable. See State v. Small, 411 A.2d 682, 685-86 (Me.1980) (receipt by sentencing justice of unsolicited letter from fire inspector that included allegations of wrongdoing against defendant with sentence recommendation did not taint proceedings where judge, after making contents known to defendant, allowing cross-examination of fire inspector and refutation of letter’s contents, did not consider allegations in passing sentence); cf. United States v. Rosner, 485 F.2d 1213, 1230 (2d Cir.1973) (decisions about appropriate procedures to ensure reliable information are largely left to the discretion of the sentencing judge), cert. denied, 417 U.S. 950, 94 S.Ct. 3080, 41 L.Ed.2d 672 (1974). We realize that several states have adopted blanket prohibitions against the use of any testimonial evidence at a sentencing hearing, offered to show aggravating or mitigating circumstances, unless it is offered in open court so as to provide the defendant an opportunity to cross-examine. See, e.g., Cal.Penal Code § 1204 (West 1982); N.D.Cent.Code § 29-26-18 (1974); Okla.Stat.tit. 22, §§ 973-975 (1981); Or. Rev.Stat. § 137.090 (1983). Some courts, independent of legislation, have similarly barred the use of information offered by either the State or the defendant unless presented in open court. See State v. Simms, 131 S.C. 422, 127 S.E. 840 (1925); State v. Rice 145 Vt. 25, 483 A.2d 248 (1984); State v. Maxwell, 328 S.E.2d 506 (W.Va.1985). The ABA Standards for Criminal Justice in like fashion provide that any information offered by the parties should be in open court. ABA Standards for Criminal Justice Standard 18-6.4(b) (1980) (“The guiding principle should be provision of an effective opportunity for both parties to rebut all allegations likely to have a significant effect on the sentence imposed.”). The rationale for such a requirement is that when the sentencing proceeding deviates from its primary investigatory function and becomes accusatorial as a result of the State’s attempt to show aggravating circumstances to warrant the enhancement of a sentence, fundamental fairness requires that the defendant be provided an opportunity to challenge the State’s information. However impartial a prosecutor may mean to be, he is an advocate, accustomed to stating only one side of a cas.e.
Although a prosecutor in offering information to the sentencing justice essentially acts in an adversarial role, it does not necessarily follow that such information is unreliable. Accordingly, we decline to adopt a per se rule requiring that information offered by the State or the defendant be subject to cross-examination. Such a rule would cause unnecessary delay in a sentencing proceeding and is not necessarily required to ensure that the information considered is factually reliable. The appropriate procedure to accomplish this goal in any given case should largely be left to the discretion of the sentencing justice. He is in a far better position to determine the procedures to be utilized if factual information is disputed by either party. One option would be that he not consider the disputed information; another possibility would be that he require the party offering the information to present it in open court subject to cross-examination. The guiding principle is that a sentence must be based on reliable factual information.
Applying these principles to the present case, we find that the justice did not abuse his discretion in considering the affidavits without furnishing to the defendant the opportunity to cross-examine the affiants. At no time did the defendant or his counsel directly dispute the accuracy or reliability of the allegations of prior unlawful conduct similar to the incidents for *168which he was charged. Even at this point the defendant does not contend that the allegations are inaccurate or unreliable. The allegations were supported by factual information provided in the form of sworn affidavits. That information was neither patently unreliable nor demonstrably false and was clearly relevant as indicative of a continuing course of conduct over a substantial period of time. See State v. O’Donnell, 495 A.2d at 803. It thus assisted the court in making an individualized assessment of the defendant’s rehabilitative prospects as well as the need to protect society.2 In these circumstances, we find no error.
The entry is:
Judgment affirmed.
McKUSICK, C.J., and ROBERTS, VIOL-ETTE and WATHEN, JJ., concurring.
. For a crime committed prior to September 23, 1983, the statute authorizing split sentences, in sentencing proceedings subsequent to that date, required that the defendant consent to any un-suspended term of imprisonment in excess of 120 days. 17-A M.R.S.A. § 1203 (Supp.1984-1985). Even though this incident occurred on August 22, 1983, the sentencing justice failed to obtain the defendant’s consent. At oral argument however before this Court, the defendant consented to the split sentence imposed and does not challenge its legality on this ground.
. There is no suggestion that the information presented in the affidavits was used by the sentencing justice to punish the defendant for an unproven crime. See State v. O'Donnell, 495 A.2d at 803; see also United States v. Grayson, 438 U.S. at 53, 98 S.Ct. at 2617.