
521 P.2d 122 (1974)
UNITED STATES FIDELITY & GUARANTY COMPANY, Plaintiff-Appellant,
v.
RATON NATURAL GAS COMPANY, a corporation, et al., Defendants-Appellees.
No. 9809.
Supreme Court of New Mexico.
April 12, 1974.
Montgomery, Federici, Andrews, Hannahs & Buell, Sumner G. Buell, Owen M. Lopez, Santa Fe, for plaintiff-appellant.
Kastler & Erwin, John P. Davidson, Robert S. Skinner, Raton, for defendants-appellees.

OPINION
MONTOYA, Justice.
This is an appeal by plaintiff United States Fidelity & Guaranty Company (appellant) from a summary judgment and order of dismissal in behalf of the defendants (appellees) from an amended complaint. The undisputed facts show that appellee Anna M. Munden (Munden) had a gas explosion and fire in her home on November 13, 1968, when her house and personal effects therein were destroyed and she suffered personal injuries. Munden was insured under a fire policy by appellant and Munden received $5,500 from appellant *123 covering her property damage loss under the policy. Thereafter, Munden filed a complaint against the other appellees complaining of tortious acts of said appellees in causing the explosion resulting in personal injuries and property damage. This suit was compromised and settled. The appellees and their insurance carrier represented by an independent adjuster had, prior to the settlement, been notified that appellant had paid Munden and claimed a right of subrogation. Despite this knowledge, the other appellees settled and compromised their suit with Munden and obtained a general release from her. Thereafter, appellant filed this suit against the appellees for its subrogation loss. Appellees answered and, among their defenses, raised the question of Munden being an indispensable party to the action. An amended complaint was filed joining Munden as a party defendant. The other appellees admitted in their answer receiving notice of appellant's subrogation claims in December 1968, and also the communication between appellant's and appellees' adjusters regarding the explosion and loss. Munden answered the amended complaint, admitted the payment of $5,500 by appellant for her loss, settlement of her lawsuit with the other appellees, and set forth other affirmative defenses and a cross-claim against the other appellees. There was an answer to the cross-claim and the other appellees asserted that Munden, by accepting a double recovery for her loss, was estopped to deny a double recovery and that an equitable estoppel was created.
On the basis of the foregoing facts, appellees except Munden filed a motion to dismiss and for summary judgment and the trial court granted the summary judgment in favor of the appellees and sua sponte dismissed the cause of action against Munden with prejudice. This appeal followed.
There are two main contentions asserted by appellant, one being that it had a legal right of subrogation which cannot be defeated by fraudulent conduct of the appellees, and that appellant, having stated a cause of action against Munden, is entitled to a hearing on the merits to prevent an injustice. The appellees, other than Munden, assert that appellant waived its right of subrogation and, if not waived, that right was destroyed by Munden under the single cause of action rule. Munden contends that no cause of action was stated against her and that if appellant had a separate cause of action, Munden had no part in it, and that Munden was not an indispensable party to such an action. Munden further contends that appellant waived its right to proceed against her.
The trial court, in disposing of the motion for summary judgment filed by appellees other than Munden, in a memorandum decision setting forth the facts on which it was based, reasoned that the appellant had not perfected its right to subrogation against appellees by having failed to request an assignment of those rights from Munden under the terms of the insurance policy, and that no action was taken by appellant until all parties had unalterably changed their position. The trial court then concluded that it would be manifestly inequitable and unjust to permit appellant to recover from appellees or Munden, and summary judgment was ordered granted in behalf of appellees other than Munden and, on its own motion, dismissed the action as against Munden.
We first consider the matters raised by the parties concerning appellant's rights to subrogation and whether the same were waived. In the instant case, which was decided below by the entry of summary judgment, the facts as set forth above are deemed to be true and there is no question that appellant was not joined in the action by Munden against the tortfeasors.
We stated in Torres v. Gamble, 75 N.M. 741, 743, 410 P.2d 959, 960 (1966):
"Since our decision in Sellman v. Haddock, 62 N.M. 391, 310 P.2d 1045, there can be no question that in this jurisdiction an insurer that has paid its insured for a loss, in whole or in part, is a necessary and indispensable party to an action to recover the amounts paid from *124 a third party allegedly responsible therefor. * * *"
In discussing the question of indispensable parties, we stated in Page v. Gallup, 26 N.M. 239, 251, 191 P. 460, 464 (1920):
"* * *. The reason for the rule is that where a party goes into a court of equity, asking the court to give him relief, he must have before the court all parties whose rights may be affected by the relief sought, because the court will not extend its arm to give him relief, at his solicitation, unless the parties to be affected are before the court and have an opportunity to resist the application, the granting of which will be detrimental to them. When a party goes to the court seeking relief, he must bring the parties to be affected by the decree before the court, otherwise the court will not act."
The trial court reasoned that because the appellant did not obtain an assignment of Munden's rights sooner and prior to her settlement with the alleged tortfeasors, that equitable principles would prevent the establishment of the subrogation claim as not having been timely perfected by the time that appellees had unalterably changed their position. The trial court was apparently persuaded by the following language contained in the insurance policy:
"This Company may require from the insured an assignment of all right of recovery against any party for loss to the extent that payment therefor is made by this Company."
We have in the past considered how the legal right of subrogation arises. In Fidelity & Deposit Co. of Maryland v. Atherton, 47 N.M. 443, 448, 144 P.2d 157, 160 (1943), we said:
"Subrogation is not necessarily founded upon contract. Crippen v. Chappel, 35 Kan. 495, 11 P. 453, 57 Am.Rep. 187; Fourth Nat. Bank v. Board of Com'rs of Craig County, 186 Okl. 102, 95 P.2d 878. It is an equitable remedy of civil law origin whereby through a supposed succession to the legal rights of another, a loss is put ultimately on that one who in equity and good conscience should pay it. American Surety Co. of New York v. Robinson, 5 Cir., 53 F.2d 22, 23; Northern Trust Co. v. Consolidated Elevator Co., 142 Minn. 132, 171 N.W. 265, 4 A.L.R. 510. It is a remedy for the benefit of one secondarily liable, who has paid the debt of another and to whom in equity and good conscience should be assigned the rights and remedies of the original creditor, Andrew v. Bevington Sav. Bank, 206 Iowa 869, 221 N.W. 668."
In State Farm Mut. Auto. Ins. Co. v. Foundation R. Ins. Co., 78 N.M. 359, 363, 431 P.2d 737, 741 (1967), we held:
"A distinction is sometimes made between legal and conventional subrogation. Legal subrogation arises by operation of law; conventional subrogation arises by convention or contract of the parties. 16 Couch, Cyclopedia of Insurance Law, § 61:2 (2d ed. Anderson 1966). Whether legal or conventional, subrogation is an equitable remedy. The remedy is for the benefit of one secondarily liable who has paid the debt of another and to whom in equity and good conscience should be assigned the rights and remedies of the original creditor. Fidelity & Deposit Co. v. Atherton, 47 N.M. 443, 144 P.2d 157 (1943)."
A good summary of the doctrine and distinction between conventional and legal subrogation is set forth in 6A Appleman, Insurance Law and Practice, § 4054 at 142-144, as follows:
"An insurer generally is entitled to subrogation, either by contract or in equity for the amount of the indemnity paid. Indeed it has been stated that the doctrine of subrogation does not depend primarily upon statutory or policy provisions, but originates in the general principles of equity, and will be applied or not according to the dictates of equity and good conscience and considerations of public policy. Such doctrine is founded upon the relationship of the parties and upon equitable principles, for the *125 purpose of accomplishing the substantial ends of justice. Subrogation rests on the maxim that no one should be enriched by another's loss. And a subrogation action by an insurer is not a suit on the insurance contract but an independent action in which equitable principles are applied to shift the loss, for which the insurer has compensated its insured, to one who caused the loss or who is legally responsible for a loss caused by another and whose equitable position is inferior to the insurer's."
We therefore hold that by operation of law when the appellant paid Munden it was subrogated to the extent that it paid Munden's loss, independent of any contract between appellant and Munden. This is particularly true in view of the factual situation present in the instant case. Here the other appellees had knowledge that appellant had paid Munden for the property damage she had suffered in the explosion.
The appellant was not a party to the suit between the other appellees and Munden, although under our recognized principles in this State the appellant was an indispensable party. It would not be fair or equitable to have the subrogation rights of the appellant defeated by legal proceedings between the other parties in an action where our rules and principles demand that appellant be joined as an indispensable party.
The trial court apparently reasoned that it would be inequitable to uphold appellant's right to subrogation against the appellees because no action was taken by appellant until appellees had "unalterably changed their position." However, the trial court failed to consider that the change of position, if any such occurred, was caused by appellees with full knowledge of appellant's claim of right to be subrogated against all of the appellees.
Appellees contend that appellant by its action waived its right to assert subrogation. On the basis of the facts admitted by the pleadings, we do not believe there was a waiver as a matter of law.
Appellees then claim that if the appellant did not waive its right to subrogation, the right was destroyed by Munden pursuant to the single cause of action rule. The single cause of action rule is to the effect that when a single wrongful act causes harm or damage to the person and property of one individual only, one single cause of action exists. See Sellman v. Haddock, 62 N.M. 391, 310 P.2d 1045 (1957). The purpose of the rule is to limit the determination of liability and responsibility therefor to only one suit or cause of action. Kidd v. Hillman, 14 Cal. App.2d 507, 58 P.2d 662 (1936); see also Annot. 62 A.L.R.2d § 3 at 982 (1958), and cases cited therein. We have in the past adhered to the single cause of action rule, but instead of allowing the insurance company to bring a separate action to claim its subrogation rights, we have held that the subrogated insurer is an indispensable party to the action that is brought by the insured to recover damages from the parties responsible therefor. Torres v. Gamble, supra.
The appellant herein was an indispensable party to the action brought by Munden against the other appellees but was not made a party. We also assume that all of the appellees had knowledge of the appellant's claim to the right of subrogation. How then do we resolve the problem before us as to whether appellant may be permitted to maintain another cause of action to protect its subrogation rights?
We find the answer to this problem in Foundation Reserve Ins. Co. v. Martin, 79 N.M. 737, 449 P.2d 339 (Ct.App. 1968), in which the insurer paid to its insured monies under the medical expense provision of an automobile policy. The insured filed suit in Bernalillo County to recover all damages suffered from the tortfeasor. Subsequent to the commencement of the litigation in Bernalillo County, the insurer also brought an action against the same tortfeasor to recover the medical expenses paid by the insurer in the District Court of San Miguel *126 County. The tortfeasor then moved to abate the action in San Miguel County District Court, successfully claiming that the insurer should properly intervene in the cause then pending in the Bernalillo County District Court. However, before the intervention was perfected in Bernalillo County, the insured and tortfeasor settled the Bernalillo County case. The insurer then filed a motion in the San Miguel County suit seeking to vacate the order which had abated the action, which motion was denied and an appeal made. In resolving the problem, the Court of Appeals stated (79 N.M. at 741, 449 P.2d at 343):
"It is apparent from a reading of the order of October 19, 1967 denying the motion to vacate the order of abatement, as well as a reading of a subsequent order of November 9, that the court construed the legal effect of the settlement made by defendants, and the subsequent dismissal of the Bernalillo County suit pursuant to that settlement, as a settlement binding on plaintiff and as an adjudication of its rights as subrogee and assignee of a portion of Avery's claim against Martin and Lease. The court was in error in so construing the effect of the settlement and the dismissal of the Bernalillo County suit.
"The defendants, and particularly Martin and Lease, the appellees herein, had full knowledge of plaintiff's claimed rights, because they entered their appearance in the present case, filed a motion to abate this case because of the prior pending suit, and contended plaintiff was an indispensable party to that prior suit. Under these circumstances, Avery, the plaintiff's insured, was in no position to settle the claimed rights of plaintiff as subrogee and assignee of a portion of his claim against Martin and Lease. The settlement was not binding on plaintiff, who in no way participated therein, and the Bernalillo County Court could not have adjudicated plaintiff's rights, because plaintiff was not a party to that suit. [Citations omitted.]"
We believe the instant case requires the same disposition made by the Court of Appeals in Foundation Reserve Ins. Co. v. Martin, supra. Sound reasons exist for the application of that rule in the case before us. Where appellees, knowing of the interest of appellant and appellant being an indispensable party to the action filed against the other appellees by Munden, and all appellees having failed to move for the joinder of appellant, appellees should not be permitted to use the settlement made in such a suit on the single cause of action rule to defeat the subrogation rights of appellant.
Insofar as the contentions made by appellee Munden are concerned, after having examined the pleadings, which of course are deemed admitted even though the dismissal by the trial court was sua sponte, we are of the opinion that a cause of action was stated against her and that appellant is entitled to present evidence in support of its claim against her. The trial court, having only stated that the equities in favor of Munden were even stronger than those in favor of the other appellees, we are in no position to review the matter since no opportunity was given to appellant to even argue the question to the trial court. At least appellant is entitled to present either legal arguments or facts in support of its claim against her.
In view of the foregoing, we believe that the trial court committed reversible error in ruling that appellant's failure to make a request for the assignment of subrogation rights from Munden destroyed the appellant's right of subrogation, and that equitable principles would not permit recovery because the filing of the instant case did not occur until all of the appellees had unalterably changed their position.
Accordingly, the order of the trial court entered June 13, 1973, is reversed and the cause is remanded to the District Court for further proceedings consistent with the exercise of the court's sound judicial discretion and with this opinion.
It is so ordered.
OMAN and STEPHENSON, JJ., concur.
