[¶ 1] The question in this case is whether Robert Levesque is entitled to an award of attorney fees because he prevailed in this declaratory judgment action brought by his insurance company. In Foremost Insurance Co. v. Levesque (Foremost I), 2005 ME 34, 868 A.2d 244, we affirmed the judgment declaring that Foremost Insurance Company had the duty to indemnify Levesque for a personal injury claim arising from an incident on Levesque’s property. Foremost now appeals from a judgment entered in the Superior Court (Cumberland County, Cole, J.) ordering Foremost to pay Levesque’s attorney fees for his defense in this action. Foremost contends that it is not liable for Levesque’s attorney fees in the declaratory judgment action because it fulfilled its duty to defend Levesque against the personal injury claim. We affirm the judgment.
I. BACKGROUND
[¶ 2] The facts of the incident that gave rise to the personal injury claim against Levesque are set forth in Foremost I. Foremost retained an attorney to defend Levesque in the underlying personal injury action under a reservation of the right to deny coverage. When Foremost filed the declaratory judgment action the retained attorney in the underlying case advised Levesque to hire other counsel to defend the new case, and Levesque hired an attorney to represent him in the declaratory judgment action.1
*1187[¶ 3] Nothing of substance transpired in the underlying case while the declaratory judgment action was pending. In its summary judgment motion in the declaratory judgment action, Foremost stated that it was seeking a declaration of both its duty to defend and its duty to indemnify. The court granted summary judgment against Foremost and declared that it had the duty to indemnify Levesque. After we affirmed the declaratory judgment in Foremost I, the underlying personal injury action settled and was dismissed.
[¶ 4] Levesque then moved in the declaratory judgment action for an order requiring Foremost to reimburse him for the amount expended on attorney fees defending against Foremost’s claim that it had no duty to indemnify. The court ordered Foremost to pay Levesque’s attorney fees, and Foremost appealed.2
II. DISCUSSION
[¶ 5] We review an award of attorney fees from an insurer to an insured de novo. Me. Mut. Fire Ins. Co. v. Gervais, 1999 ME 134, ¶ 6, 745 A.2d 360, 362. Whether the court has authority to award attorney fees is a matter of law. Gibson v. Farm Family Mut. Ins. Co., 673 A.2d 1350, 1354 (Me.1996).
[¶ 6] This declaratory judgment action is a contract dispute. It asked the court to determine whether the insurance contract required Foremost to indemnify Levesque for the personal injury claim against him. Generally, the prevailing party in a breach of contract action is not entitled to attorney fees absent a provision in the contract requiring payment of such fees. Id. The so-called American Rule provides that parties are responsible for their own attorney fees absent a statutory or contractual provision stating otherwise. Union Mut. Fire Ins. Co. v. Town of Topsham, 441 A.2d 1012, 1017 (Me.1982). However, with respect to insurance contracts, we have declared that an insurer may be liable for an insured’s attorney fees in a declaratory judgment action in which the insured or the insurer seeks to establish the insurer’s duty to defend and a comparison of the complaint with the policy demonstrates potential liability within the coverage of the policy. Gibson, 673 A.2d at 1354-55; Union Mut. Fire Ins. Co., 441 A.2d at 1019.
*1188[¶ 7] The Legislature codified this requirement that insurance companies pay the attorney fees of the insured when the insured prevails in a declaratory judgment action to establish the insurer’s duty to defend subsequent to our decision in Gibson. The statute states that when there is a declaratory judgment action “to determine an insurer’s contractual duty to defend an insured under an insurance policy, if the insured prevails in such action, the insurer shall pay court costs and reasonable attorney’s fees.” 24-A M.R.S. § 2436-B(2) (2006).
[¶ 8] We have not previously determined whether an insurer is liable for the insured’s attorney fees when the insured has to defend against the insurer’s suit seeking a declaration that there is no duty to indemnify. Section 2436-B(2) does not answer the question because it speaks only to actions “to determine an insurer’s contractual duty to defend.”
[¶ 9] While it may be possible to interpret “duty to defend” in section 2436-B(2) as including the phrase “duty to indemnify,” we do not think that such an approach is warranted. The Legislature clearly intended to codify the law with regard to duty to defend. It did not speak one way or the other to the duty to indemnify. Because statutory law does not answer the question, we are left to decide as a matter of common law whether there should be an exception to the American Rule when the insured prevails in a lawsuit on the duty to indemnify in which the insured has had to incur attorney fees and costs to defend the suit.
[¶ 10] In Gibson, we spoke of the “special relationship between insurer and insured” and the heavy burden that can fall on an insured when the insurer unsuccessfully forces the insured to defend a declaratory judgment action. Gibson, 673 A.2d at 1354. We said that the insured should be “place[d] ... in a position equally as good as the insured would have occupied had the insurance contract been fully and properly performed from the beginning.” Id. at 1355. The same reasons that support the assessment of attorney fees in a duty to defend action also support the assessment of fees in a duty to indemnify action.
[¶ 11] Foremost contracted with Levesque to defend and pay claims against him for personal injuries occurring on his property. When such a claim was made against Levesque, Foremost properly hired an attorney to defend Levesque, but while that underlying case was pending, Foremost sought a declaration that it did not have to pay any claim. If Levesque had not defended against that declaratory judgment action, a default judgment would have issued against Levesque, and Foremost would have prevailed even though it was responsible under the insurance contract to indemnify Levesque. Levesque chose to contest the declaratory judgment action and to hire an attorney to do so. Levesque’s decision to hire an attorney allowed him to prevail in the declaratory judgment case and obtain a judgment stating that Foremost had a duty to indemnify Levesque. Although the insurance policy required Foremost to pay the personal injury claim, Levesque incurred a substantial attorney fee to obtain this result and through no fault of his own. Unless we extend the common law exception to the American Rule that we developed in Gibson and Union Mutual to include duty to indemnify actions, Levesque’s contractual right is substantially diminished.
[¶ 12] There is no dispute that a declaratory judgment action to determine a duty to defend places an onerous burden on the insured and that the prospect of having to pay attorney fees makes the insurance company appropriately cautious. Levesque’s position in this case is as onerous as that of an insured who is initially met *1189with a duty to defend suit. Successful insureds in both situations lose financially unless they are made whole by payment of their attorney fees.
[¶ 13] A distinction between duty to defend cases and duty to indemnify cases is that duty to defend cases involve the comparison of the policy with the alleged facts of the complaint whereas duty to indemnify cases involve the comparison of the policy with the facts proved at trial. See York Ins. Group of Me. v. Lambert, 1999 ME 173, ¶¶ 4-5, 740 A.2d 984, 985. That distinction is not relevant here. As discussed above, Foremost sought a declaration of its duty to indemnify while the underlying personal injury suit was pending and before the facts were proved. To the extent that there is a difference between the two cases because the duty to indemnify is narrower than the duty to defend, that difference is not significant when the duty to indemnify action is brought before judgment in the underlying case and when, as here, it essentially stops the underlying case. Just as the prevailing insured in the duty to defend action loses a substantial benefit of the insurance when he is sued by the insurer, the prevailing insured in the duty to indemnify action loses the benefit of his bargain with his insurer when he has to pay an attorney to defend him against the insurer.
[¶ 14] We recognize that most states deciding this issue have not deviated from the American Rule for either the duty to defend or duty to indemnify declaratory judgment actions.3 Indeed, we noted in Union Mutual that more states had denied attorney fees to insureds than had allowed the recovery of fees. 441 A.2d at 1018. Nonetheless, we decided to join the minority of jurisdictions who allowed fees. Id. at 1019.
[¶ 15] There are several jurisdictions that allow attorney fees when an insured defends a declaratory judgment action brought by the insurer. These jurisdictions have extended the right to recover attorney fees because the “disparity of bargaining power between an insurance company and its policyholder makes the insurance contract substantially different from other commercial contracts.” Olympic S.S. Co. v. Centennial Ins. Co., 117 Wash.2d 37, 811 P.2d 673, 681 (Wash.1991). A West Virginia case noted that the insured purchased her policy to protect herself from future litigation, not to incur “vexatious, time-consuming, expensive litigation with [her] insurer.”4 Hayseeds, *1190Inc. v. State Farm Fire & Cas., 177 W.Va. 323, 352 S.E.2d 73, 79 (1986).
[¶ 16] In addition to Washington and West Virginia, New York also allows attorney fees. In United States Underwriters Insurance Co. v. City Club Hotel, LLC, 3 N.Y.3d 592, 789 N.Y.S.2d 470, 822 N.E.2d 777, 779-80 (2004), the court held that an insurer that brought a declaratory judgment action to determine its duty to indemnify the insured must pay the insured’s attorney fees because “an insurer’s duty to defend extends to the defense of any action arising out of the occurrence, including a defense against an insurer’s declaratory judgment action.”
[¶ 17] We are persuaded that we should extend the rule announced in Union Mutual and Gibson to declaratory judgment actions by an insurer seeking a declaration that it has no duty to indemnify. When an insured prevails after incurring legal fees to defend a suit brought by its insurer, policy reasons support the allowance of attorney fees to the insured. Unsuccessful litigation filed by an insurer against its insured subjects the insured to significant costs that may render victory for the insured on the indemnification issue meaningless. In that case, the insured will be in no better position than he would be without having purchased insurance.
[¶ 18] Because Levesque incurred attorney fees when he successfully defended against Foremost’s declaratory judgment action on the duty to indemnify, the Superior Court properly awarded Levesque attorney fees.
The entry is:
Judgment affirmed.
. Contrary to our admonitions in Patrons Oxford Mutual Insurance Co. v. Garcia, 1998 ME 38, ¶ 10, 707 A.2d 384, 387, and Travelers *1187Indemnity Co. v. Dingwell, 414 A.2d 220, 227 (Me.1980), Foremost brought its declaratory judgment action seeking a determination of its duty to indemnify while the underlying personal injury case was pending. The duty to indemnify may depend on the actual facts of the underlying case in contrast to the duly to defend, which arises when a comparison of the complaint with the policy demonstrates a potential for coverage. U.S. Fid. & Guar. Co. v. Rosso, 521 A.2d 301, 303 (Me.1987). We have said that the duty to indemnify action should not be brought, or should be stayed, until the underlying action is completed in order to avoid duplicative litigation and to spare insureds the costs of declaratory judgment actions. Id. at 303 & n. 1; see also N. Sec. Ins. Co. v. Dolley, 669 A.2d 1320, 1323 (Me.1996) (stating that if a court concludes that an insurer owes its insured the duty to defend her in the underlying action then the court should delay ruling on indemnity, because facts may come out in the course of the action that are material to the issue); Am. Universal Ins. Co. v. Cummings, 475 A.2d 1136, 1137 n. 1 (Me.1984) ("caution[ing] against prematurely deciding the issue of indemnification’ ’).
. Foremost argued in the Superior Court that Levesque’s motion for attorney fees was untimely pursuant to M.R. Civ. P. 54(b)(3), and he raises that issue on appeal. We agree with the court that Levesque's motion is timely because he filed his motion for fees within thirty days of final disposition. See M.R. Civ. P. 54(b)(3). Also, the court noted that the motion came as no surprise to Foremost because after each stage of the litigation, Levesque submitted attorney fees statements to Foremost asking the company to pay for his attorney’s services.
. Currently, eight jurisdictions hold that attorney fees cannot be awarded. First State Underwriters Agency of New Eng. Reinsurance Corp. v. Travelers Ins. Co., 803 F.2d 1308, 1318 (3d Cir.1986) (applying Pennsylvania law); Gibson v. S. Gen. Ins. Co., 199 Ga.App. 776, 406 S.E.2d 121, 124 (1991); Bhd. Mut. Ins. Co. v. Roseth, 177 Ill.App.3d 443, 126 Ill.Dec. 669, 532 N.E.2d 354, 360-61 (1988); N.H. Ins. Co. v. Christy, 200 N.W.2d 834, 845 (Iowa 1972); Nelson v. Am. Reliable Ins. Co., 286 Minn. 21, 174 N.W.2d 126, 131 (1970); Lujan v. Gonzales, 84 N.M. 229, 501 P.2d 673, 682-83 (Ct.App.1972); Am. States Ins. Co. v. Walker, 26 Utah 2d 161, 486 P.2d 1042, 1044 (1971); see Green v. Standard Fire Ins. Co. of Ala., 477 So.2d 333, 335 (Ala.1985). Five states disallow attorney fees when the insured files the declaratory judgment action to determine coverage, but these states have not ruled on whether the same result would apply if the insurer had filed the declaratory judgment action. Previews, Inc. v. Cal. Union Ins. Co., 640 F.2d 1026, 1029-30 (9th Cir.1981) (applying California law); State Farm Mut. Auto. Ins. Co. v. O’Brien, 24 Ariz.App. 18, 535 P.2d 46, 49-50 (1975); Alambro v. Salman, 536 So.2d 764, 767 (La.Ct.App.1988); Eagle Fire Prot. Corp. v. First Indem. of Am. Ins. Co., 145 N.J. 345, 678 A.2d 699, 708-09 (1996); Carter v. Va. Sur. Co., 187 Tenn. 595, 216 S.W.2d 324, 328 (1948).
. The Supreme Court of Appeals of West Virginia further explained its choice to adopt the minority view this way:
Although the disparity of bargaining power between company and policyholder (often exacerbated by the dynamics of the *1190settlement bureaucracy) make insurance contracts substantially different from other commercial contracts, efforts to provide greater balance have been halting at best, and have often depended upon fictions such as lack of "good faith” to circumvent general prohibitions against fee-shifting. The unstructured and nebulous nature of the rules concerning good faith settlement of policy claims in property damage cases is directly related to the American rule that both sides of a civil controversy must pay their own attorneys’ fees — win, lose, or draw. In many social contexts this rule makes eminently good sense .... However, the fact that the general rule concerning fees works well most of the time does not necessarily imply that the rule works well all of the time.
Hayseeds, Inc. v. State Farm Fire & Cas., 177 W.Va. 323, 352 S.E.2d 73, 78 (1986) (citation omitted).