
449 A.2d 358 (1982)
HORACE MANN INSURANCE CO.
v.
MAINE TEACHERS ASSOCIATION and
Maine Teachers Association Affiliated Units and
Merrymeeting Educators' Association[1].
Supreme Judicial Court of Maine.
Argued June 10, 1982.
Decided August 16, 1982.
*359 Berman, Simmons, Laskoff & Goldberg, P. A., Julian L. Sweet (orally), Gary Goldberg, Lewiston, for plaintiff.
Sunenblick, Fontaine & Reben, Howard T. Reben (orally), Thomas L. Bohan, Portland, for defendant.
Before McKUSICK, C. J., and GODFREY, ROBERTS, CARTER, VIOLETTE and WATHEN, JJ.
CARTER, Justice.
Summary judgment was entered for the plaintiff in the Superior Court, Androscoggin County, which ruled that the plaintiff-insurer had no duty to defend the defendant-insured in an underlying proceeding before the Maine Labor Relations Board (MLRB). On this appeal, the defendants claim that the motion justice did not correctly apply the controlling principles of law to determine the extent of the plaintiff's obligations under the insurance policy. We affirm the judgment.
Norman P. Whitzell filed with the Maine Labor Relations Board a prohibited practices complaint. Whitzell alleged therein that, as an employee of Maine School Administrative District # 75, he was represented for collective bargaining purposes by Merrymeeting Educators' Association (MEA), which is affiliated with the Maine Teachers Association (MTA). Pursuant to the collective bargaining agreement then in force, there existed a four-step grievance procedure to settle disputes between the employees and the Board of Directors for MSAD # 75, and MEA was contractually obligated to pursue the grievances of the employees. Whitzell also alleged that he was a beneficiary of this duty, even though he was not a member of the MEA.
Whitzell made the following further allegations in the prohibited practices complaint. The School Board tendered him notice of termination in March 1979, to be effective in August 1979. He invoked the grievance procedures and was represented by MEA through the first three levels. MEA subsequently withdrew from its representation of Whitzell after providing notice to him preceding the submission of his grievance to arbitration, which is Level IV. The collective "bargaining agreement precluded individual prosecution of grievances" through arbitration and he was thus effectively denied an opportunity to invoke that procedure. As a result, the discharge became effective.
Whitzell also asserted before the MLRB that MEA therefore "breached its duty of fair representation" in failing to represent him and to pursue the grievance, thereby violating state law, and that MEA discriminated against Whitzell on the ground that he was not a member of the organization, also assertedly in violation of state law. The ad damnum clause of that complaint sought both a ruling that MEA breached its duty of fair representation and relief from MEA as compensation for the unemployment caused by the allegedly unlawful termination. Apparently, the MLRB proceeding was resolved favorably to MEA.
From September 1, 1978, to September 1, 1979, the defendant, Maine Teachers Association Affiliated Units, was the named insured on a policy issued by the plaintiff, Horace Mann. In section B(I)(A) of the contract, the plaintiff agreed:

*360 To indemnify Insured against any liability arising from any claim or claims which may be made against Insured by reason of:
. . . . .
4) Interference with the business, trade or professional relationships of any third parties whether or not members of the insured association, but only as to damage to such relationships and arising solely from the written or oral declaration of the insured association,
committed or alleged to have been committed and arising out of the conduct of the insured's activities as an Association of Teachers and/or School Administrators.
The plaintiff initiated the action at bar for a declaratory judgment that it had no duty under the terms of this policy to defend or indemnify the defendants in the MLRB proceedings commenced by Whitzell. See 14 M.R.S.A. §§ 5951-5963. The Superior Court reasoned that Whitzell's prohibited practices complaint, even when liberally construed, did not allege a claim within the scope of the policy's coverage. Summary judgment was granted for the plaintiff.
In order for the duty of defense to arise, the underlying complaint need only show, through general allegations, a possibility that the liability claim falls within the insurance coverage. There is no requirement that the facts alleged in the complaint specifically and unequivocally make out a claim within the coverage. Moreover, where there is an ambiguity in the language of the policy, the doubt should be resolved in favor of finding that the insurer has a duty to defend the insured.
Union Mutual Fire Insurance Co. v. Inhabitants of Topsham, Me., 441 A.2d 1012, 1015 (1982) (emphasis added). Accord Travelers Indemnity Co. v. Dingwell, Me., 414 A.2d 220, 226 (1980); Marston v. Merchants Mutual Insurance Co., Me., 319 A.2d 111, 114 (1974). Therefore, the insurer is under no obligation to defend its insured in the underlying proceeding if, when the allegations contained in the petition are compared with the terms and provisions of the contract, there exists no legal or factual basis, which could be developed under that pleading at trial or hearing, that would obligate the insurer to pay under the policy.
This "comparison test," by which the existence of a duty to defend is determined through an examination of the pleadings and the terms of the insurance policy, remains the proper basis upon which to delineate the scope of the insurer's obligation to the insured, notwithstanding some suggestion in the record on this appeal that the underlying administrative proceeding has reached a final disposition.[2] The duty to defend is invoked by the filing of a complaint, the allegations of which potentially expose the insured to liability which can be construed as falling within the scope of insurance coverage. See Mt. Hope Inn v. Travelers Indemnity Co., 157 N.J.Super. 431, 437, 384 A.2d 1159, 1162 (1978); Holland America Insurance Co. v. National Indemnity Co., 75 Wash.2d 909, 912, 454 P.2d 383, 385 (1969); see generally 7C Appleman, Insurance Law and Practice § 4683.01 at 63 (Berdal rev. 1979). Because the duty to defend thus arises before the underlying proceeding is brought to trial or hearing, the facts as actually adduced there cannot be determinative of the existence and extent of the insurer's contractual obligations. Accordingly, even if the facts alleged by Whitzell in his prohibited practices complaint have been subject to proof and disproof at the MLRB proceeding, we review the Superior Court's finding of no duty exclusively in light of the prohibited practices complaint and the terms of the policy, rather than in light of any facts established *361 before the MLRB. See American Policyholders' Insurance Co. v. Cumberland Cold Storage Co., Me., 373 A.2d 247, 249 (1977) ("... the obligation of a liability insurance company to defend an action brought against the insured by a third party is to be determined solely by the allegations contained in the complaint in that action").
Whitzell's prohibited practices complaint seeks relief for an alleged breach by the insured of its statutory duty to represent fairly the employees of MSAD # 75, including Whitzell, and for alleged discrimination against non-members of the teachers' association (Whitzell), also in contravention of statutory proscriptions. The factual gravamen of the complaint is the insured association's withdrawal of its representation of Whitzell during the grievance procedure instituted after he was discharged from employment. Significantly, the only allegations included in the prohibited practices complaint of any behavior by the insured which could be construed as an oral or written declaration is the insured's notice to Whitzell himself "that it would not submit his grievance to arbitration."
Section B(I)(A) of the insurance policy, quoted supra, on the other hand, limits coverage to liability arising from interference by the insured with the professional relationships of any third parties, "but only as to damage to such relationships and arising solely from the written or oral declaration of the insured association." (emphasis added). It is clear from a reading of the prohibited practices complaint, however, that the damages sought by Whitzell were those caused by the insured's withdrawal of its representation and its allegedly discriminatory treatment of Whitzell, which flowed from that withdrawal. The exclusive basis of Whitzell's claim, in other words, is the insured's failure to pursue Whitzell's grievance on his behalf, rather than any declarations that the insured may have made. In order for the duty to defend to exist, the "liability claim" in the underlying action must fall within the scope of insurance coverage. Union Mutual, 441 A.2d at 1015. Because Whitzell sought to establish the liability of the insured on the sole basis of its failure to represent him, the complaint, so construed, does not expose the insured to liability covered by the insurance: "written or oral declarations." See C. O. Morgan Lincoln-Mercury, Inc. v. Vigilant Insurance Co., 521 S.W.2d 318 (Tex.Civ.App.1975).
The defendants also contend on this appeal that the insured's notice sent to Whitzell that it would no longer represent him would be taken as a message by the school board-employer that Whitzell's grievance was not meritorious. Aside from the merits of such a claim, the complaint cannot be read as asserting it, for the complaint seeks a remedy for the termination of representation itself, not for the "declaration" that effected it. Such a declaration does not constitute the "liability claim," which, here, is the breach of the insured's duty of fair representation. That declaration thus cannot operate to create coverage in this instance. Similarly, even if the defendants are also correct, as they argue here, that the notice sent to Whitzell inaccurately stated that Whitzell himself could pursue his grievance independently, such a representation again does not fall within the purview of the liability claim, because it could not form the basis for an ultimate determination by the MLRB that the withdrawal constituted a failure to represent Whitzell fairly.
The defendants argue finally that the proof adduced at the MLRB hearing might have demonstrated that it made a variety of statements to the school board during the course of their representation of Whitzell. The prohibited practices complaint, however, contains no suggestion whatsoever that such statements were made. Such a circumstance, which cannot be seen to be contemplated by the allegations in the complaint, cannot constitute a basis for a determination that coverage exists.
Accordingly, the Superior Court was correct in determining that the prohibited practices complaint did not allege any potential basis for liability within the scope of the coverage afforded by the insurance policy.
*362 The entry is:
Judgment affirmed.
All concurring.
NOTES
[1]  We have deleted from the caption Norman P. Whitzell and the Maine Labor Relations Board. As they were never served with process, they were never properly before this Court in this action.
[2]  We also note that the issue of the duty to defend is not rendered moot simply because the underlying proceeding may have been subject to final disposition. Rather, if the insurer's refusal to defend was improper, it may be liable to the insured for the costs incurred by the insured in defending the suit. See 7C Appleman, Insurance Law and Practice § 4691 (Berdal rev. 1979); see also Union Mutual, 441 A.2d at 1017-19 (discussing extent of insurer's liability for insured's expenses arising out of declaratory judgment action).
