
122 Ill. App.3d 301 (1983)
461 N.E.2d 471
THE FIDELITY & CASUALTY COMPANY OF NEW YORK, Plaintiff-Appellee,
v.
ENVIRODYNE ENGINEERS, INC., et al., Defendants (Envirodyne Engineers, Inc., Defendant-Appellant).
No. 83-803.
Illinois Appellate Court  First District (4th Division).
Opinion filed December 29, 1983.
Rehearing denied March 22, 1984.
*302 Jay A. Schiller, of Chicago, for appellant.
Clausen, Miller, Gorman, Caffrey & Witous, P.C., of Chicago (James T. Ferrini, Frank L. Schneider, and Lisa D. Marco, of counsel), for appellee.
Judgment affirmed.
JUSTICE JIGANTI delivered the opinion of the court:
This appeal arises from the trial court's determination in a declaratory judgment proceeding that the plaintiff, The Fidelity & Casualty Company of New York (Fidelity), was under no obligation to defend or indemnify its insured, defendant Envirodyne Engineers, Inc. (Envirodyne), in a separate personal injury claim filed by one Ben E. Guzman. Envirodyne was insured by Fidelity under a comprehensive general liability policy. The policy contained an exclusion providing: "It is agreed that the insurance does not apply to bodily injury or property damage arising out of the rendering of or the failure to render any professional services by or for the names insured including * * * supervisory, inspection or engineering services."
Guzman was allegedly injured while working as an employee at a construction project. Envirodyne was engaged as the project's consulting engineer by the Illinois State Toll Highway Authority. Guzman brought suit against both Envirodyne and the Highway Authority, alleging that both parties had violated the Structural Work Act (Ill. Rev. Stat. 1981, ch. 48, pars. 60-69) and that both parties were also liable in negligence.
Fidelity defended Envirodyne in the Guzman case under a reservation *303 of rights. It concurrently filed a suit for a declaratory judgment against Envirodyne alleging that Envirodyne's activities at the job site "were `supervisory, inspection or engineering services' within the purview of" the endorsement in their policy. Therefore, Fidelity contended, Envirodyne had no coverage under the policy and Fidelity was under no obligation to defend or indemnify Envirodyne in the Guzman lawsuit. The trial court granted summary judgment in favor of Fidelity and against Envirodyne. Envirodyne now appeals.
Two broad contentions have been argued by Envirodyne throughout its brief. Envirodyne first contends that the court in the declaratory judgment proceeding improperly looked beyond the complaint in the underlying personal injury case when it ruled upon Fidelity's duty to defend Envirodyne in the Guzman lawsuit. The second argument raised by Envirodyne is that the declaratory proceeding determined one of the ultimate issues upon which recovery was predicated in the Guzman case and that the trial court's ruling was therefore improper under Maryland Casualty Co. v. Peppers (1976), 64 Ill.2d 187, 355 N.E.2d 24.
We shall first address Envirodyne's contention that the trial court may look only to the complaint in the underlying lawsuit when determining, in a separate declaratory judgment action, whether an insurer owes a duty to its insured to defend the insured in the underlying action. In the case at bar, Guzman's complaint states that Envirodyne and the Highway Authority "erected, constructed, placed or operated or caused to be erected, constructed, placed or operated, a certain scaffold * * *." It was undisputed during appellate oral arguments that the above-quoted language is the only portion of the Guzman complaint which could conceivably fall within the confines of the general liability policy issued by Fidelity. If Envirodyne physically constructed the scaffold, there would be coverage under the general liability policy; however, if Envirodyne acted only as a consulting engineer, there would be no coverage because of the exclusion.
Prior to granting summary judgment in the declaratory proceeding, the trial court examined the contract between Envirodyne and the Highway Authority. The contract stated that Envirodyne's duties at the construction site were limited to those of a consulting engineer. In addition, over Envirodyne's objection, the trial judge ordered the deposition of Michael Endress, who was a professional engineer and the assistant vice-president of Envirodyne. Endress stated that Envirodyne was an engineering firm, that Envirodyne was the general consultant for the Highway Authority and that he was unaware of any functions performed by Envirodyne at the job site other than *304 those which were architectural or engineering in nature. In conjunction with the contract and the deposition, the trial judge also considered the decision in Wheeler v. Aetna Casualty & Surety Co. (1973), 11 Ill. App.3d 841, 854, 298 N.E.2d 329, 338, vacated as moot (1974), 57 Ill.2d 184, 311 N.E.2d 134, where the court took judicial notice "that employees of contractors and subcontractors place and operate hoists and that architects and their employees never do so." Envirodyne argues that the trial court was bound to look only to the Guzman complaint when it determined the issue of coverage and that it therefore improperly considered the Highway Authority contract and the Endress deposition. We disagree.
 1, 2 The well established general rule is that the allegations in the complaint in the underlying action determine an insurer's duty to defend its insured. (See, e.g., Thornton v. Paul (1978), 74 Ill.2d 132, 384 N.E.2d 335; Maryland Casualty Co. v. Peppers (1976), 64 Ill.2d 187, 355 N.E.2d 24; Annot., 50 A.L.R.2d 458, 465 (1956 & Supps. 1967, 1983).) In conjunction with this general rule, however, the law states that when an insurer is in doubt regarding its duty to defend, it may seek a declaratory judgment as to its obligations and rights or defend the insured under a reservation of rights. (Sims v. Illinois National Casualty Co. (1963), 43 Ill. App.2d 184, 193 N.E.2d 123; see also Murphy v. Urso (1981), 88 Ill.2d 444, 430 N.E.2d 1079.) The insurer may concurrently seek a declaratory judgment and defend under a reservation of rights, as Fidelity did in the instant case. Country Mutual Insurance Co. v. Murray (1968), 97 Ill. App.2d 61, 239 N.E.2d 498.
 3, 4 Based upon the law above recited, we find no support for Envirodyne's contention that the court may not look beyond the underlying complaint even in a declaratory proceeding where the duty to defend is at issue. It is certainly true that the duty to defend flows in the first instance from the allegations in the underlying complaint; this is the concern at the initial stage of the proceedings when an insurance company encounters the primary decision of whether to defend its insured. However, if an insurer opts to file a declaratory proceeding, we believe that it may properly challenge the existence of such a duty by offering evidence to prove that the insured's actions fell within the limitations of one of the policy's exclusions. (See 7C Appleman, Insurance Law & Practice sec. 4683, at 53 (1979); see also Kepner v. Western Fire Insurance Co. (1973), 109 Ariz. 329, 509 P.2d 222; Employers' Fire Insurance Co. v. Beals (1968), 103 R.I. 623, 240 A.2d 397.) The only time such evidence should not be permitted is when it tends to determine an issue crucial to the determination of *305 the underlying lawsuit (see Maryland Casualty Co. v. Peppers (1976), 64 Ill.2d 187, 355 N.E.2d 24; Employers' Fire Insurance Co. v. Beals (1968), 103 R.I. 623, 240 A.2d 397), a concern which shall be addressed in depth later in this opinion. If a crucial issue will not be determined, we see no reason why the party seeking a declaration of rights should not have the prerogative to present evidence that is accorded generally to a party during a motion for summary judgment in a declaratory proceeding. To require the trial court to look solely to the complaint in the underlying action to determine coverage would make the declaratory proceeding little more than a useless exercise possessing no attendant benefit and would greatly diminish a declaratory action's purpose of settling and fixing the rights of the parties. Envirodyne offers no authority to support this untoward result.
While we have been unable to find an instance where the issue of admitting evidence beyond the underlying complaint has been squarely addressed before, we have encountered a number of Illinois cases where evidence was apparently presumed to be admissible in declaratory judgment proceedings such as the one at issue here. In Mid America Fire & Marine Insurance Co. v. Smith (1982), 109 Ill. App.3d 1121, 441 N.E.2d 949, the trial court considered documents, including deposition testimony, when ruling on an insurer's duty to defend in a motion for summary judgment in a declaratory proceeding. In two other Illinois cases, the court went beyond the underlying complaint to take judicial notice of the scope of the duties performed by professional architects and engineers. (Wheeler v. Aetna Casualty & Surety Co. (1973), 11 Ill. App.3d 841, 298 N.E.2d 329, vacated as moot (1974), 57 Ill.2d 184, 311 N.E.2d 134; Sheppard, Morgan & Schwaab, Inc. v. United States Fidelity & Guaranty Co. (1976), 44 Ill. App.3d 481, 358 N.E.2d 305.) Furthermore, although the case was approached under a different procedural setting than that encountered here, the supreme court found that it was permissible to go beyond the complaint on the issue of coverage in Thornton v. Paul (1979), 74 Ill.2d 132, 384 N.E.2d 335. There the court looked to a criminal conviction as prima facie evidence of the facts upon which it was based to hold that an insured's conduct fell within an exclusion of his insurance policy. We believe that the above cases are sufficiently analogous to the case at bar to lend support for allowing evidence beyond the complaint in a declaratory judgment action such as the one at issue here.
 5 Before progressing to the next issue on appeal, we believe it important to distinguish this case, where the insurer exercised its options to defend under a reservation of rights and to file a declaratory *306 judgment action, from those cases where the insurer elects neither option and refuses to defend an insured who ultimately incurs an adverse judgment. In the latter case, the insurer is estopped from raising noncoverage as a defense to an action brought to recover policy proceeds and therefore, the insurer is necessarily bound to the allegations in the underlying complaint.[1] (See Sims v. Illinois National Casualty Co. (1963), 43 Ill. App.2d 184, 193 N.E.2d 123; see also Shaw v. Aetna Casualty & Surety Co. (7th Cir.1969), 407 F.2d 813.) However, when an insurer has elected to either defend under a reservation of rights or file a declaratory judgment action, this estoppel concept does not arise (see Ayers v. Bituminous Insurance Co. (1981), 100 Ill. App.3d 33, 424 N.E.2d 1316) and the insurer may present evidence beyond the underlying complaint, so long as it does not tend to determine an ultimate issue in the underlying proceeding.
We must next decide whether the trial court improperly determined an ultimate fact in the underlying action when it granted summary judgment in favor of Fidelity in the declaratory proceeding. The leading Illinois Supreme Court case in this area is Maryland Casualty Co. v. Peppers (1976), 64 Ill.2d 187, 355 N.E.2d 24. In Peppers, the plaintiff in the underlying tort case alleged intentional, negligent, and wilful and wanton conduct on the part of the insured party. The insured and the insurer were parties to an insurance policy which contained an exclusion for intentionally inflicted injuries. The insurer filed suit for a declaratory judgment, alleging that the insured's conduct was intentional and that therefore, the policy exclusion was applicable. In the declaratory proceeding, the trial court found that the insured had intentionally injured the plaintiff in the underlying tort case and that consequently, there was no coverage under the policy. The supreme court found that the trial court had abused its discretion by ruling on the intentional injury issue prior to the completion of the underlying tort action. Specifically, the trial court's ruling was premature because it had determined one of the ultimate facts upon which recovery was predicated in the underlying case and because the underlying plaintiff would be wrongfully estopped from raising one of *307 his theories of recovery, namely that of negligent conduct, in the underlying tort case. The supreme court therefore vacated the trial court's ruling as being premature. See also State Farm Fire & Casualty Co. v. Moore (1981), 103 Ill. App.3d 250, 257, 430 N.E.2d 641, 647 ("the court in the declaratory judgment action cannot determine the ultimate question of the insured's liability [or] the facts upon which such liability is based").
In Thornton v. Paul (1978), 74 Ill.2d 132, 384 N.E.2d 335, an insurance policy contained an exclusion for injury arising out of assault and battery. The supreme court observed that "it would not be appropriate" for the insurer to seek a declaratory judgment that the insured's conduct constituted a battery and was therefore beyond the coverage of the policy. Relying upon Peppers, the court stated: "In such a proceeding, an issue crucial to the insured's liability in the personal injury action and also one on which punitive damages could ultimately be assessed would be determined in a purely ancillary proceeding with the plaintiff and defendant in the personal injury action both aligned on the same side as defendants in the declaratory judgment action. Also, the order and burden of proof would be oriented to and dictated by the declaratory judgment action and not by the primary litigation, the personal injury suit." 74 Ill.2d 132, 159, 384 N.E.2d 335, 346.
Both Peppers and Thornton are instructive as to what matters cannot be determined in a declaratory judgment proceeding prior to the completion of the underlying action. Peppers states that an ultimate fact upon which recovery is predicated in the underlying case may not be addressed. The court's language suggests that an ultimate fact is one which would estop the plaintiff in the underlying case from pursuing one of his theories of recovery. Thornton implies that an ultimate fact is one in which "an issue crucial to the insured's liability" in the underlying case is determined. Apparently only then would the inequities surface in regard to alignment of the parties and the order and burden of proof, because those matters necessarily arise in any declaratory judgment proceeding brought before completion of the underlying lawsuit. Thus, in examining the facts in the instant case, we must decide whether the plaintiff in the underlying lawsuit would be estopped from raising a theory of recovery or if the trial court decided an issue crucial to the insured's liability in the underlying case.
 6 The sole issue determined by the trial court in the declaratory proceeding was the nature of the services performed by Envirodyne at the construction site. Specifically, the court found that any actions taken by Envirodyne at the job site were performed in its capacity as *308 a consulting engineer. We do not see where this determination in any way estops the underlying plaintiff from raising a theory of recovery or decides any issue crucial to the underlying litigation. The allegations set forth in the underlying complaint are violations of the Structural Work Act and negligence. A finding that Envirodyne performed as a consulting engineer in no way diminishes either theory of recovery advanced by the underlying plaintiff. Similarly, the fact that Envirodyne acted as a consulting engineer at the job site is not an issue crucial to Envirodyne's liability in the underlying case; the ultimate, or crucial, queries in this case revolve around whether Envirodyne was "in charge" of the construction, whether Envirodyne "wilfully" violated the Structural Work Act or whether Envirodyne acted negligently. None of these questions hinges upon whether Envirodyne did or did not serve in the capacity of consulting engineer for the construction project. In contrast, when the trial court in the Peppers case decided that the insured had acted intentionally, the court in effect decided the intentional tort count pleaded in the underlying plaintiff's case. Similarly, in Thornton, if the trial court had decided that the insured's conduct constituted a battery, it would have decided an issue that was central to the insured's liability in the underlying case. No analogous situation arises in the case at bar. A finding that Envirodyne was acting in a professional capacity could in no way determine whether Envirodyne violated the Structural Work Act or whether Envirodyne acted negligently. We conclude that the nature of Envirodyne's services at the job site was not an issue of ultimate fact and that therefore, the trial court properly determined the issue of coverage in the declaratory proceeding by looking to facts beyond those contained in the underlying complaint.
For the foregoing reasons, the judgment of the trial court is affirmed.
ROMITI, P.J., and JOHNSON, J., concur.
NOTES
[1]  A related but different situation may arise when the insurer defends its insured in the underlying action but does not either defend under a reservation of rights or file a declaratory judgment proceeding. If the insurer later contests the issue of coverage, it may be estopped from denying its own liability under the policy. (See Apex Mutual Insurance Co. v. Christner (1968), 99 Ill. App.2d 153, 240 N.E.2d 742.) It is generally the rule in such a case that the insured must demonstrate prejudice in order to estop the insurer from asserting a defense of noncoverage. See Maryland Casualty Co. v. Peppers (1976), 64 Ill.2d 187, 355 N.E.2d 24.
