
529 A.2d 806 (1987)
J.A.J., INC.
v.
The AETNA CASUALTY AND SURETY COMPANY.
Supreme Judicial Court of Maine.
Argued May 7, 1987.
Decided August 18, 1987.
*807 Joseph M. Jabar (orally), Daviau, Jabar & Batten, Waterville, for plaintiff.
George C. Schelling (orally), Gross, Minsky, Mogul & Singal, Bangor, for defendant.
Before McKUSICK, C.J., and NICHOLS, ROBERTS,[*] WATHEN, GLASSMAN, SCOLNIK and CLIFFORD, JJ.
NICHOLS, Justice.
Underlying this appeal is a complaint entered in Superior Court (Kennebec County) by Paul O'Neal against J.A.J., Inc., seeking damages for injuries he sustained immediately after visiting an establishment it owned and operated on Temple Street, in Waterville. As amended by him, Count I of O'Neal's complaint alleged in pertinent part:
3. That on or about November 3, 1977, Defendant J.A.J., Inc., through its agents or employees, negligently and in violation of 28 M.R.S.A. § 1058, as amended, served Plaintiff, Paul O'Neal, intoxicating liquors while he was already in a state of intoxication.
4. That the serving of said intoxicating liquors caused Plaintiff, Paul O'Neal, to become further intoxicated to such an extent that he was unable to exercise a reasonable degree of care in his own conduct for his own safety.
5. That in spite of Plaintiff, Paul O'Neal's obvious state of intoxication and lack of control over his own conduct, Defendant negligently allowed him to leave his establishment unattended.

6. That as Plaintiff, Paul O'Neal left Defendant's establishment, he was set upon by two other patrons of Defendant's establishment, who had been in Defendant's establishment at the same time as Plaintiff, Paul O'Neal, and who had also been served intoxicating liquors by Defendant, through its agents, servants or employees.
(emphasis added). Count II repeated and reasserted all of the allegations contained in the first count and added:
3. That said service of intoxicating liquor to Plaintiff, Paul O'Neal, under these circumstances [state of intoxication] constituted negligent behavior on the part of the Defendant.
J.A.J., Inc., had a policy of comprehensive general liability insurance issued it by Aetna Casualty and Surety Company that contained the following exclusion:
[This insurance does not apply:] to bodily injury or property damage for which the insured or his indemnitee may be held liable
(1) as a person or organization engaged in the business of manufacturing, distributing, selling or serving alcoholic beverages....
Upon being served with O'Neal's amended complaint, J.A.J., Inc., notified the Defendant company that O'Neal was alleging negligence, as well as a violation of Maine's Dram Shop Act, and thus the insurer had a duty to defend. The Defendant company, however, refused to defend J.A.J., Inc., in O'Neal's action against it.
The Plaintiff thereupon commenced this action against the Defendant company to recover for the expenses it incurred in defending O'Neal's action.[1]*808 The Superior Court entered summary judgment for the Defendant company on the ground "that the allegations in the complaint allege only violations involving or arising out of the sale and consumption of alcoholic beverages which fall outside the coverage of the insurance policy at issue in this matter." On appeal, the Plaintiff contends that the Defendant company had a duty to defend it because the complaint in the O'Neal action alleged a common law theory of negligence that was not excluded by the insurance policy.
We agree, and accordingly we vacate the order granting summary judgment.
Whether an insurer has a duty to defend is determined by comparing the provisions of the insurance contract with the allegations in the underlying complaint. If there is any legal or factual basis that could be developed at trial, which would obligate the insurer to pay under the policy, the insured is entitled to a defense. American Policyholders' Insurance Co. v. Kyes, 483 A.2d 337, 339 (Me.1984). It is not essential that the complaint specifically and unequivocally make out a claim within the policy. On the contrary,
[w]hether [one] can obtain a defense from his insurer must depend not on the caprice of the plaintiff's draftmanship, nor the limits of his knowledge, but on a potential shown in the complaint that the facts ultimately proved may come within the coverage. Even a complaint which is legally insufficient to withstand a motion to dismiss gives rise to a duty to defend if it shows an intent to state a claim within the insurance coverage.
Travelers Indemnity Co. v. Dingwell, 414 A.2d 220, 226 (Me.1980).
If O'Neal's complaint in the underlying action had only alleged that J.A.J., Inc., had violated the provisions of the Dram Shop Act and was without any allegation of common law negligence, the Defendant insurer would not have had a duty to defend because both causes of action would clearly have been excluded under its policy of insurance. That is not, however, all that was alleged in O'Neal's complaint. While one could argue that O'Neal's paragraphs 5 and 6 premise J.A.J., Inc.'s, negligence in allowing the Plaintiff to leave its premises upon the fact that he and his assailants were intoxicated, O'Neal's complaint went on to contain a more general allegation of negligence, unaffected by alcohol consumption. Illustratively, O'Neal could have attempted to prove that J.A.J., Inc., was negligent because it allowed him to leave the premises unescorted or without warning knowing that the patrons were developing an antagonistic relationship that would undoubtedly end in a harmful confrontation. Because it is not essential that O'Neal's complaint state with specificity every fact that ultimately must be proved for him to prevail on the negligence theory, paragraphs 5 and 6 of O'Neal's complaint adequately set forth enough to invoke this insurer's duty to defend. Any doubt about the adequacy of the pleadings to bring the occurrence within the coverage of the insurance policy should be resolved in favor of the insured. 7C Appleman, Insurance Law and Practice § 4683 (1979).
We conclude that a potential for liability within the coverage appeared from the allegations made by O'Neal. Travelers Indemnity Co. v. Dingwell, 414 A.2d at 226.
Accordingly, the entry is:
Judgment vacated.
Remanded for further proceedings consistent with the opinion herein.
All concurring.
NOTES
[*]  Roberts, J., sat at oral argument and participated in the initial conference, but participated no further.
[1]  The Superior Court entered judgment, upon the jury's verdict, in favor of J.A.J., Inc., in the underlying action. The issue of the duty to defend, however, is not rendered moot merely because the underlying proceeding has been finally resolved. Horace Mann Insurance Co. v. Maine Teachers Association, 449 A.2d 358, 360 n. 2 (Me.1982). Furthermore, because the duty to defend arises before the underlying proceeding is brought to trial, "the facts as actually adduced there cannot be determinative of the existence and extent of the insurer's contractual obligation." Id. at 360.
