
545 N.W.2d 451 (1996)
249 Neb. 783
LEADER NATIONAL INSURANCE COMPANY, an Ohio corporation, Appellant,
v.
AMERICAN HARDWARE INSURANCE GROUP, Appellee.
No. S-94-437.
Supreme Court of Nebraska.
April 5, 1996.
*453 Thomas D. Wulff and Dennis W. Clark, of Welch, Wulff & Childers, Omaha, for appellant.
Dan H. Ketcham, of Hansen, Engles & Locher, P.C., Omaha, for appellee.
WHITE, C.J., CAPORALE, FAHRNBRUCH, LANPHIER, WRIGHT, CONNOLLY, and GERRARD, JJ.
FAHRNBRUCH, Judge.
The issue in this subrogation appeal is whether the insurer of the negligent driver of a vehicle or the insurer of the owner of the vehicle involved in an accident should pay for the damages suffered by third parties.
The trial court found that, under the amended petition filed in this case, the insurer of the owner of the vehicle, American Hardware Insurance Group (American), could not be held liable for the damages paid to third parties by the driver's insurer, Leader National Insurance Company (Leader). We affirm.

ASSIGNMENT OF ERROR
In substance, Leader claims that the trial court erred in sustaining American's demurrer to Leader's amended petition, which the court found did not state a cause of action.

STANDARD OF REVIEW
When reviewing an order sustaining a demurrer, an appellate court accepts the truth of the facts which are well pled, together with the proper and reasonable inferences of law and fact which may be drawn therefrom, but does not accept as true the conclusions of the pleader. Seevers v. Potter, 248 Neb. 621, 537 N.W.2d 505 (1995). In reviewing a ruling on a general demurrer, an appellate court cannot assume the existence of a fact not alleged, make factual findings to aid the pleading, or consider evidence which might be adduced at trial. Proctor v. Minnesota Mut. Fire & Cas., 248 Neb. 289, 534 N.W.2d 326 (1995). In ruling on a demurrer, the petition is to be liberally construed; if as so construed the petition states a cause of action, the demurrer is to be overruled. Vowers & Sons, Inc. v. Strasheim, 248 Neb. 699, 538 N.W.2d 756 (1995). A statement of facts sufficient to constitute a cause of action means a narrative of the events, acts, and things done or omitted which shows a legal liability of the defendant to the plaintiff. Wheeler v. Nebraska State Bar Assn., 244 Neb. 786, 508 N.W.2d 917 (1993), cert. denied ___ U.S. ___, 114 S.Ct. 1835, 128 L.Ed.2d 463 (1994).

FACTS
Leader's amended petition against American alleged that Leader's insured, Thomas *454 Lustgraaf, test-drove a Nissan Sentra owned by Bellevue Nissan, Inc. During his test drive, Lustgraaf collided with a car and continued on and struck a gasoline dispenser and other property at a convenience store. Two suits were filed against Lustgraaf for property damage arising out of the accidents.
Lustgraaf demanded that Bellevue Nissan's vehicle liability insurer, American, defend, indemnify, and pay all damages stemming from the accidents. American denied coverage. Leader defended Lustgraaf and settled all claims arising from the accidents for $9,418.05. In its amended petition, Leader alleged that American, under its insurance policy with Bellevue Nissan, had the primary duty to defend and indemnify potential customers involved in a collision while test-driving a vehicle owned by Bellevue Nissan.
Leader claimed in its amended petition that it was entitled to subrogation against American and prayed for judgment against American for damages it had paid as a result of Lustgraaf's accidents, together with interest and court costs.
Attached to Leader's amended petition was the American policy insuring Bellevue Nissan. A demurrer reaches an exhibit filed with the petition and made a part thereof, so that a court can consider such exhibit in determining whether the petition states a cause of action. Vowers & Sons, Inc. v. Strasheim, supra.
American's insurance policy declarations reflect that Bellevue Nissan is an auto dealer. Under the liability coverage section, the insurance policy contains the following paragraph under its definitions of who is insured:
(2) Anyone else while using with your permission a covered "auto" you own, hire or borrow except:

....
(d) Your customers, if your business is shown in the Declarations as an "auto" dealership. However, if a customer of yours:
(i) Has no other available insurance (whether primary, excess or contingent), they are an "insured" but only up to the compulsory or financial responsibility law limits where the covered "auto" is principally garaged.
(ii) Has other available insurance (whether primary, excess or contingent) less than the compulsory or financial responsibility law limits where the covered "auto" is principally garaged, they are an "insured" only for the amount by which the compulsory or financial responsibility law limits exceed the limits of their other insurance.
(Emphasis supplied.)
Also attached to Leader's amended petition are exhibits which reflect that Lustgraaf intended to buy from Bellevue Nissan the Sentra he was driving at the time of the accidents involved here. One exhibit reflects that Lustgraaf was having difficulty obtaining financing to purchase the Sentra. According to the exhibit, during the test drive that resulted in the accidents involved in this case, Lustgraaf intended for his mother to take the car to her credit union to obtain the necessary financing to purchase the Sentra. In any event, Lustgraaf was the driver of the car at the time of the accident.
Following a hearing, the trial court sustained American's demurrer to Leader's amended petition. Leader elected to stand on its amended petition, and the trial court dismissed it.

ANALYSIS
Subrogation is the substitution of one person in the place of another with reference to a lawful claim, demand, or right, so that the one who is substituted succeeds to the rights of the other in relation to the debt or claim, and its rights, remedies, or securities. Chadron Energy Corp. v. First Nat. Bank, 236 Neb. 173, 459 N.W.2d 718 (1990). Generally, subrogation is the right of one, who has paid an obligation which another should have paid, to be indemnified by the other. Horton v. Ford Life Ins. Co., 246 Neb. 171, 518 N.W.2d 88 (1994). To be entitled to subrogation, one must pay a debt for which another is liable. Shelter Ins. Cos. v. Frohlich, 243 Neb. 111, 498 N.W.2d 74 (1993).
*455 In order for Leader's amended petition seeking subrogation against American to state a cause of action, it must allege that American is liable for the obligations paid by Leader. Whether American has a duty to pay for damages caused by the negligent test-driving of Lustgraaf, a customer of American's insured, Bellevue Nissan, can be discerned from the language of American's policy insuring Bellevue Nissan, which Leader included as part of its petition.
In appellate review of an insurance policy, the court construes the policy as any other contract to give effect to the parties' intentions at the time the contract was made. Where the terms of such a contract are clear, they are to be accorded their plain and ordinary meaning. Standard Fed. Sav. Bank v. State Farm, 248 Neb. 552, 537 N.W.2d 333 (1995). The parties to an insurance contract may contract for any lawful coverage, and the insurer may limit its liability and impose restrictions and conditions upon its obligation under the contract not inconsistent with public policy or statute. Dalton Buick v. Universal Underwriters Ins. Co., 245 Neb. 282, 512 N.W.2d 633 (1994).
The relevant terms of American's policy insuring Bellevue Nissan are clear. American insures a customer of Bellevue Nissan who with permission borrows a vehicle owned by Bellevue Nissan only if that customer carries vehicle liability insurance less than that required by law. Such a contract is not inconsistent with public policy or statute. See Universal Underwriters Ins. Co. v. Farm Bureau Ins. Co., 243 Neb. 194, 498 N.W.2d 333 (1993) (insurer of auto dealership not required by law to insure customer who damages loaner car).
Under the facts of this case, at the time of the accidents, Lustgraaf was a customer of Bellevue Nissan. See, Aubrey v. Harleysville Ins. Companies, 140 N.J. 397, 658 A.2d 1246 (1995); Winn v. Becker, 660 A.2d 284 (Vt.1995); Yosemite Ins. v. State Farm Mut., 98 Nev. 460, 653 P.2d 149 (1982).
Leader's amended petition alleges that Leader insured Lustgraaf, defended Lustgraaf, and paid third parties for damages they suffered. It is evident that Lustgraaf was sufficiently insured as required by law and, in any event, was sufficiently insured to cover the damages he caused while driving Bellevue Nissan's vehicle. American's policy insuring Bellevue Nissan, which was attached to the amended petition, conclusively contradicts the amended petition's allegation that American had the primary duty to defend Lustgraaf. Under American's policy, American had no duty to defend Lustgraaf.

CONCLUSION
Under the state of the record, we affirm the judgment of the district court sustaining American's demurrer, and because Leader elected to stand on its amended pleading, we affirm the dismissal of Leader's lawsuit.
AFFIRMED.
